Skip to content

Commit

Permalink
修复亮暗主题自动切换功能无效的问题(#1697
Browse files Browse the repository at this point in the history
  • Loading branch information
lyswhut committed Nov 22, 2023
1 parent 1712e46 commit 3e7db56
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions publish/changeLog.md
Expand Up @@ -12,10 +12,15 @@

- 若自定义源初始化失败,将会出现弹窗提示初始化失败的详情

### 优化

- 更新zh-tw翻译

### 修复

- 修复备份文件无法导入json格式的问题
- Windows、MacOS平台下的字体列表取消使用原生方式获取以修复某些字体应用后无效的问题(#1596
- 修复亮暗主题自动切换功能无效的问题(#1697

### 其他

Expand Down
2 changes: 1 addition & 1 deletion src/lang/en-us.json
Expand Up @@ -596,7 +596,7 @@
"sync__dislike_title": "Choose how to sync with {name}'s dislike list",
"sync__list_merge_tip_desc": "Merge the two lists together, the same song will be removed (the song of the merged person is removed), and different songs will be added.",
"sync__list_other_tip_desc": "\"Cancel Sync\" will not use list sync.",
"sync__list_overwrite_tip_desc": "The list with the same ID of the covered person and the covered list will be deleted and replaced with the list of the covered person (lists with different list IDs will be merged together). If you check Complete coverage, all lists of the covered person will be moved. \nDivide, and then replace with a list of overriders.",
"sync__list_overwrite_tip_desc": "Lists with the same ID as the overwritten list and the overwritten list will be deleted and replaced with the overrider's list (lists with different list IDs will be merged together). If full coverage is checked, all lists of the covered one will be moved. Remove and replace with a list of overrides.",
"sync__list_title": "Choose how to synchronize the list with {name}",
"sync__merge_btn_local_remote": "Local list merge remote list",
"sync__merge_btn_remote_local": "Remote list merge local list",
Expand Down
2 changes: 1 addition & 1 deletion src/lang/zh-tw.json
Expand Up @@ -596,7 +596,7 @@
"sync__dislike_title": "選擇與 {name} 的不喜歡清單同步方式",
"sync__list_merge_tip_desc": "將兩邊的列表合併到一起,相同的歌曲將被去掉(去掉的是被合併者的歌曲),不同的歌曲將被添加。",
"sync__list_other_tip_desc": "「取消同步」將不使用清單同步功能。",
"sync__list_overwrite_tip_desc": "被覆蓋者與覆蓋者清單ID相同的清單將被刪除後替換成覆蓋者的清單(清單ID不同的清單將合併為一起),若勾選完全覆蓋,則被覆蓋者的所有清單將會被移\n,然後替換成覆蓋者的列表。",
"sync__list_overwrite_tip_desc": "被覆蓋者與覆蓋者清單ID相同的清單將被刪除後替換成覆蓋者的清單(清單ID不同的清單將合併為一起),若勾選完全覆蓋,則被覆蓋者的所有清單將會被移除,然後替換成覆蓋者的列表。",
"sync__list_title": "選擇與 {name} 的列表同步方式",
"sync__merge_btn_local_remote": "本機列表 合併 遠端列表",
"sync__merge_btn_remote_local": "遠端列表 合併 本機列表",
Expand Down
10 changes: 6 additions & 4 deletions src/main/app.ts
Expand Up @@ -172,9 +172,11 @@ export const listenerAppEvent = (startApp: () => void) => {
initScreenParams()
})

nativeTheme.addListener('updated', (event: any) => {
const themeInfo: Electron.NativeTheme = event.sender
global.lx?.event_app.system_theme_change(themeInfo.shouldUseDarkColors)
nativeTheme.addListener('updated', () => {
const shouldUseDarkColors = nativeTheme.shouldUseDarkColors
if (shouldUseDarkColors == global.lx.theme.shouldUseDarkColors) return
global.lx.theme.shouldUseDarkColors = shouldUseDarkColors
global.lx?.event_app.system_theme_change(shouldUseDarkColors)
})
}

Expand Down Expand Up @@ -224,7 +226,7 @@ export const initAppSetting = async() => {
state: new Map(),
},
theme: {
shouldUseDarkColors: false,
shouldUseDarkColors: nativeTheme.shouldUseDarkColors,
theme: {
id: '',
name: '',
Expand Down

0 comments on commit 3e7db56

Please sign in to comment.