Skip to content

Commit 62966cc

Browse files
fix(任务栏歌词): 修复重启后悬浮对齐设置丢失的问题
初始化时同步所有任务栏歌词配置到主进程,确保 electron-store 与 settingStore 状态一致。
1 parent 33c209e commit 62966cc

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

src/composables/useInit.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,36 @@ export const useInit = () => {
7979
window.electron.ipcRenderer.send("win-loaded");
8080
// 同步任务栏歌词状态
8181
window.electron.ipcRenderer.send("taskbar:toggle", statusStore.showTaskbarLyric);
82+
83+
// 初始化时同步任务栏歌词配置到主进程,确保 electron-store 与 settingStore 一致
84+
// 修复任务栏歌词悬浮对齐设置可能在重启后丢失的问题
85+
updateTaskbarConfig({
86+
mode: settingStore.taskbarLyricMode,
87+
maxWidth: settingStore.taskbarLyricMaxWidth,
88+
position: settingStore.taskbarLyricPosition,
89+
autoShrink: settingStore.taskbarLyricAutoShrink,
90+
margin: settingStore.taskbarLyricMargin,
91+
minWidth: settingStore.taskbarLyricMinWidth,
92+
93+
floatingAlign: settingStore.taskbarLyricFloatingAlign,
94+
floatingAutoWidth: settingStore.taskbarLyricFloatingAutoWidth,
95+
floatingWidth: settingStore.taskbarLyricFloatingWidth,
96+
floatingHeight: settingStore.taskbarLyricFloatingHeight,
97+
floatingAlwaysOnTop: settingStore.taskbarLyricFloatingAlwaysOnTop,
98+
99+
showWhenPaused: settingStore.taskbarLyricShowWhenPaused,
100+
showCover: settingStore.taskbarLyricShowCover,
101+
themeMode: settingStore.themeMode,
102+
fontFamily: settingStore.LyricFont,
103+
globalFont: settingStore.globalFont,
104+
fontWeight: settingStore.taskbarLyricFontWeight,
105+
animationMode: settingStore.taskbarLyricAnimationMode,
106+
singleLineMode: settingStore.taskbarLyricSingleLineMode,
107+
showWordLyrics: settingStore.taskbarLyricShowWordLyrics,
108+
showTranslation: settingStore.showTran,
109+
showRomaji: settingStore.showRoma,
110+
});
111+
82112
// 显示桌面歌词
83113
window.electron.ipcRenderer.send("desktop-lyric:toggle", statusStore.showDesktopLyric);
84114
// 检查更新

0 commit comments

Comments
 (0)