Merge cfb6b9287f into d92e34949c
This commit is contained in:
commit
c351a927ba
@ -153,6 +153,8 @@ const modules = {
|
|||||||
download_list_update: 'download_list_update',
|
download_list_update: 'download_list_update',
|
||||||
download_list_remove: 'download_list_remove',
|
download_list_remove: 'download_list_remove',
|
||||||
download_list_clear: 'download_list_clear',
|
download_list_clear: 'download_list_clear',
|
||||||
|
|
||||||
|
on_open_setting:'on_open_setting'
|
||||||
},
|
},
|
||||||
winLyric: {
|
winLyric: {
|
||||||
close: 'close',
|
close: 'close',
|
||||||
|
|||||||
@ -5,9 +5,11 @@ import {
|
|||||||
hideWindow as hideMainWindow,
|
hideWindow as hideMainWindow,
|
||||||
isExistWindow as isExistMainWindow,
|
isExistWindow as isExistMainWindow,
|
||||||
isShowWindow as isShowMainWindow,
|
isShowWindow as isShowMainWindow,
|
||||||
|
sendEvent,
|
||||||
showWindow as showMainWindow,
|
showWindow as showMainWindow,
|
||||||
} from './winMain'
|
} from './winMain'
|
||||||
import { quitApp } from '@main/app'
|
import { quitApp } from '@main/app'
|
||||||
|
import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames'
|
||||||
|
|
||||||
let tray: Electron.Tray | null
|
let tray: Electron.Tray | null
|
||||||
let isEnableTray: boolean = false
|
let isEnableTray: boolean = false
|
||||||
@ -138,6 +140,13 @@ export const createMenu = () => {
|
|||||||
showMainWindow()
|
showMainWindow()
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
menu.push({
|
||||||
|
label: '设置',
|
||||||
|
click() {
|
||||||
|
sendEvent(WIN_MAIN_RENDERER_EVENT_NAME.on_open_setting)
|
||||||
|
showMainWindow()
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
menu.push(global.lx.appSetting['desktopLyric.enable']
|
menu.push(global.lx.appSetting['desktopLyric.enable']
|
||||||
? {
|
? {
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { getFontSizeWithScreen } from '@renderer/utils'
|
|||||||
import {
|
import {
|
||||||
minWindow,
|
minWindow,
|
||||||
onFocus,
|
onFocus,
|
||||||
|
onOpenSetting,
|
||||||
onSettingChanged,
|
onSettingChanged,
|
||||||
onThemeChange,
|
onThemeChange,
|
||||||
openDevTools,
|
openDevTools,
|
||||||
@ -104,6 +105,10 @@ export default () => {
|
|||||||
window.app_event.configUpdate()
|
window.app_event.configUpdate()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const rOpenSetting = onOpenSetting(({}) => {
|
||||||
|
window.location.href="#/setting"
|
||||||
|
})
|
||||||
|
|
||||||
const rFocus = onFocus(() => {
|
const rFocus = onFocus(() => {
|
||||||
clearDownKeys()
|
clearDownKeys()
|
||||||
})
|
})
|
||||||
@ -145,5 +150,6 @@ export default () => {
|
|||||||
rSetConfig()
|
rSetConfig()
|
||||||
rFocus()
|
rFocus()
|
||||||
rThemeChange()
|
rThemeChange()
|
||||||
|
rOpenSetting()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,13 @@ export const onSettingChanged = (listener: LX.IpcRendererEventListenerParams<Par
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const onOpenSetting = (listener: LX.IpcRendererEventListenerParams<Partial<LX.AppSetting>>): RemoveListener => {
|
||||||
|
rendererOn(WIN_MAIN_RENDERER_EVENT_NAME.on_open_setting, listener)
|
||||||
|
return () => {
|
||||||
|
rendererOff(WIN_MAIN_RENDERER_EVENT_NAME.on_open_setting, listener)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const sendInited = () => {
|
export const sendInited = () => {
|
||||||
rendererSend(WIN_MAIN_RENDERER_EVENT_NAME.inited)
|
rendererSend(WIN_MAIN_RENDERER_EVENT_NAME.inited)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user