桌面歌词新增在任务栏显示歌词进程设置(#1063)

This commit is contained in:
lyswhut
2022-11-26 13:51:27 +08:00
parent 67a3ab164a
commit 9e51a55d45
12 changed files with 34 additions and 5 deletions
+10 -1
View File
@@ -31,6 +31,9 @@ const winEvent = () => {
browserWindow.on('closed', () => {
browserWindow = null
if (global.lx.appSetting['desktopLyric.enable']) {
global.lx.event_app.update_config({ 'desktopLyric.enable': false })
}
})
browserWindow.on('move', () => {
@@ -86,6 +89,7 @@ export const createWindow = () => {
let height = global.lx.appSetting['desktopLyric.height']
let isAlwaysOnTop = global.lx.appSetting['desktopLyric.isAlwaysOnTop']
let isLockScreen = global.lx.appSetting['desktopLyric.isLockScreen']
let isShowTaskbar = global.lx.appSetting['desktopLyric.isShowTaskbar']
let { width: screenWidth, height: screenHeight } = global.envParams.workAreaSize
if (x == null || y == null) {
x = screenWidth - width
@@ -122,7 +126,7 @@ export const createWindow = () => {
fullscreenable: false,
show: false,
alwaysOnTop: isAlwaysOnTop,
skipTaskbar: true,
skipTaskbar: !isShowTaskbar,
webPreferences: {
contextIsolation: false,
webSecurity: false,
@@ -173,6 +177,11 @@ export const setIgnoreMouseEvents = (ignore: boolean, options?: Electron.IgnoreM
browserWindow.setIgnoreMouseEvents(ignore, options)
}
export const setSkipTaskbar = (skip: boolean) => {
if (!browserWindow) return
browserWindow.setSkipTaskbar(skip)
}
export const setAlwaysOnTop = (flag: boolean, level?: 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver' | undefined, relativeLevel?: number | undefined) => {
if (!browserWindow) return
browserWindow.setAlwaysOnTop(flag, level, relativeLevel)