diff --git a/publish/changeLog.md b/publish/changeLog.md index f8d2ef9c..41196e6d 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -18,6 +18,7 @@ - 桌面歌词新增竖排歌词显示功能(#971) - 桌面歌词新增歌词对齐方式、是否不允许歌词换行、歌词颜色、滚动对齐方式、歌词间距设置 - 桌面歌词新增歌曲频谱显示(得益于主窗口与桌面歌词进程通信的改进,可以将此功能以CPU使用率“相对较低”的方式带到桌面歌词中) +- 桌面歌词新增在任务栏显示歌词进程设置(此设置用于在录屏软件无法捕获歌词窗口时的变通解决方法)(#1063) - 添加kg源罗马音歌词的支持 - 支持打开波点音乐歌单(需在酷我源打开) diff --git a/src/common/defaultSetting.ts b/src/common/defaultSetting.ts index 81b6748e..bec8c7a2 100644 --- a/src/common/defaultSetting.ts +++ b/src/common/defaultSetting.ts @@ -43,6 +43,7 @@ const defaultSetting: LX.AppSetting = { 'desktopLyric.isLock': false, 'desktopLyric.isAlwaysOnTop': false, 'desktopLyric.isAlwaysOnTopLoop': false, + 'desktopLyric.isShowTaskbar': false, 'desktopLyric.audioVisualization': false, 'desktopLyric.width': 450, 'desktopLyric.height': 300, diff --git a/src/common/types/app_setting.d.ts b/src/common/types/app_setting.d.ts index 1dae619a..14404fec 100644 --- a/src/common/types/app_setting.d.ts +++ b/src/common/types/app_setting.d.ts @@ -189,6 +189,11 @@ declare global { */ 'desktopLyric.isAlwaysOnTopLoop': boolean + /** + * 是否将歌词进程显示在任务栏 + */ + 'desktopLyric.isShowTaskbar': boolean + /** * 是否启用音频可视化 */ diff --git a/src/common/types/desktop_lyric.d.ts b/src/common/types/desktop_lyric.d.ts index b57515f0..734becbf 100644 --- a/src/common/types/desktop_lyric.d.ts +++ b/src/common/types/desktop_lyric.d.ts @@ -5,6 +5,7 @@ declare namespace LX { 'desktopLyric.isLock': LX.AppSetting['desktopLyric.isLock'] 'desktopLyric.isAlwaysOnTop': LX.AppSetting['desktopLyric.isAlwaysOnTop'] 'desktopLyric.isAlwaysOnTopLoop': LX.AppSetting['desktopLyric.isAlwaysOnTopLoop'] + 'desktopLyric.isShowTaskbar': LX.AppSetting['desktopLyric.isShowTaskbar'] 'desktopLyric.audioVisualization': LX.AppSetting['desktopLyric.audioVisualization'] 'desktopLyric.width': LX.AppSetting['desktopLyric.width'] 'desktopLyric.height': LX.AppSetting['desktopLyric.height'] diff --git a/src/lang/en-us.json b/src/lang/en-us.json index 0c69f395..f6754888 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -322,6 +322,7 @@ "setting__desktop_lyric_scroll_align_center": "Center", "setting__desktop_lyric_scroll_align_top": "Top", "setting__desktop_lyric_shadow_color": "Shadow color", + "setting__desktop_lyric_show_taskbar": "Display lyrics progress on the taskbar (this setting is used as a workaround when the screen recording software cannot capture the lyrics window)", "setting__desktop_lyric_unplay_color": "Color not playing", "setting__download": "Download", "setting__download_data_embed": "Whether to embed the following content in the audio file", @@ -512,6 +513,7 @@ "theme_blue": "Blue", "theme_blue2": "Purple Blue", "theme_blue_plus": "Blue Plus", + "theme_china_ink": "China Ink", "theme_edit_modal__app_bg": "Apply background color", "theme_edit_modal__aside_color": "Sidebar button color", "theme_edit_modal__badge": "Label color", @@ -551,7 +553,6 @@ "theme_pink": "Pink", "theme_purple": "Purple", "theme_red": "Red", - "theme_china_ink": "China Ink", "theme_selector_modal__dark_title": "dark theme", "theme_selector_modal__light_title": "Bright theme", "theme_selector_modal__theme_name": "Topic name", diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index 89d4674a..224eb584 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -324,6 +324,7 @@ "setting__desktop_lyric_scroll_align_center": "中心", "setting__desktop_lyric_scroll_align_top": "顶部", "setting__desktop_lyric_shadow_color": "阴影颜色", + "setting__desktop_lyric_show_taskbar": "在任务栏显示歌词进程(此设置用于在录屏软件无法捕获歌词窗口时的变通解决方法)", "setting__desktop_lyric_unplay_color": "未播放颜色", "setting__download": "下载设置", "setting__download_data_embed": "是否将以下内容嵌入到音频文件中", @@ -514,6 +515,7 @@ "theme_blue": "蓝田生玉", "theme_blue2": "清热版蓝", "theme_blue_plus": "蛋雅深蓝", + "theme_china_ink": "近墨者黑", "theme_edit_modal__app_bg": "应用背景颜色", "theme_edit_modal__aside_color": "侧栏按钮颜色", "theme_edit_modal__badge": "标签颜色", @@ -553,7 +555,6 @@ "theme_pink": "粉装玉琢", "theme_purple": "重斤球紫", "theme_red": "热情似火", - "theme_china_ink": "近墨者黑", "theme_selector_modal__dark_title": "暗色主题", "theme_selector_modal__light_title": "亮色主题", "theme_selector_modal__theme_name": "主题名称", diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index 2d9efda8..a9539768 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -323,6 +323,7 @@ "setting__desktop_lyric_scroll_align_center": "中心", "setting__desktop_lyric_scroll_align_top": "頂部", "setting__desktop_lyric_shadow_color": "陰影顏色", + "setting__desktop_lyric_show_taskbar": "在任務欄顯示歌詞進程(此設置用於在錄屏軟件無法捕獲歌詞窗口時的變通解決方法)", "setting__desktop_lyric_unplay_color": "未播放顏色", "setting__download": "下載設置", "setting__download_data_embed": "是否將以下內容嵌入到音頻文件中", @@ -512,6 +513,7 @@ "theme_blue": "藍田生玉", "theme_blue2": "清熱版藍", "theme_blue_plus": "蛋雅深藍", + "theme_china_ink": "近墨者黑", "theme_edit_modal__app_bg": "應用背景顏色", "theme_edit_modal__aside_color": "側欄按鈕顏色", "theme_edit_modal__badge": "標籤顏色", @@ -551,7 +553,6 @@ "theme_pink": "粉裝玉琢", "theme_purple": "重斤球紫", "theme_red": "熱情似火", - "theme_china_ink": "近墨者黑", "theme_selector_modal__dark_title": "暗色主題", "theme_selector_modal__light_title": "亮色主題", "theme_selector_modal__theme_name": "主題名稱", diff --git a/src/main/modules/winLyric/config.ts b/src/main/modules/winLyric/config.ts index 47c03134..3c7c3d5e 100644 --- a/src/main/modules/winLyric/config.ts +++ b/src/main/modules/winLyric/config.ts @@ -1,5 +1,5 @@ import { isLinux } from '@common/utils' -import { closeWindow, createWindow, getBounds, isExistWindow, alwaysOnTopTools, setBounds, setIgnoreMouseEvents } from './main' +import { closeWindow, createWindow, getBounds, isExistWindow, alwaysOnTopTools, setBounds, setIgnoreMouseEvents, setSkipTaskbar } from './main' import { sendConfigChange } from './rendererEvent' import { buildLyricConfig, getLyricWindowBounds, watchConfigKeys } from './utils' @@ -7,6 +7,7 @@ let isLock: boolean let isEnable: boolean let isAlwaysOnTop: boolean let isAlwaysOnTopLoop: boolean +let isShowTaskbar: boolean let isLockScreen: boolean let isHoverHide: boolean @@ -37,6 +38,10 @@ export const setLrcConfig = (keys: Array, setting: Partial< alwaysOnTopTools.startLoop() } else alwaysOnTopTools.clearLoop() } + if (keys.includes('desktopLyric.isShowTaskbar') && isShowTaskbar != global.lx.appSetting['desktopLyric.isShowTaskbar']) { + isShowTaskbar = global.lx.appSetting['desktopLyric.isShowTaskbar'] + setSkipTaskbar(!global.lx.appSetting['desktopLyric.isShowTaskbar']) + } if (keys.includes('desktopLyric.isAlwaysOnTopLoop') && isAlwaysOnTopLoop != global.lx.appSetting['desktopLyric.isAlwaysOnTopLoop']) { isAlwaysOnTopLoop = global.lx.appSetting['desktopLyric.isAlwaysOnTopLoop'] if (!global.lx.appSetting['desktopLyric.isAlwaysOnTop']) return diff --git a/src/main/modules/winLyric/main.ts b/src/main/modules/winLyric/main.ts index 2ce0ee79..27b76dec 100644 --- a/src/main/modules/winLyric/main.ts +++ b/src/main/modules/winLyric/main.ts @@ -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) diff --git a/src/main/modules/winLyric/utils.ts b/src/main/modules/winLyric/utils.ts index ad84d64e..1354accc 100644 --- a/src/main/modules/winLyric/utils.ts +++ b/src/main/modules/winLyric/utils.ts @@ -80,6 +80,7 @@ export const watchConfigKeys = [ 'desktopLyric.isLock', 'desktopLyric.isAlwaysOnTop', 'desktopLyric.isAlwaysOnTopLoop', + 'desktopLyric.isShowTaskbar', 'desktopLyric.audioVisualization', 'desktopLyric.width', 'desktopLyric.height', diff --git a/src/renderer-lyric/store/state.ts b/src/renderer-lyric/store/state.ts index 8fcf2109..82432220 100644 --- a/src/renderer-lyric/store/state.ts +++ b/src/renderer-lyric/store/state.ts @@ -5,6 +5,7 @@ export const setting = shallowReactive({ 'desktopLyric.isLock': false, 'desktopLyric.isAlwaysOnTop': false, 'desktopLyric.isAlwaysOnTopLoop': false, + 'desktopLyric.isShowTaskbar': true, 'desktopLyric.audioVisualization': false, 'desktopLyric.width': 450, 'desktopLyric.height': 300, diff --git a/src/renderer/views/Setting/components/SettingDesktopLyric.vue b/src/renderer/views/Setting/components/SettingDesktopLyric.vue index 20d667f2..23174436 100644 --- a/src/renderer/views/Setting/components/SettingDesktopLyric.vue +++ b/src/renderer/views/Setting/components/SettingDesktopLyric.vue @@ -11,6 +11,8 @@ dd base-checkbox(id="setting_desktop_lyric_delayScroll" :modelValue="appSetting['desktopLyric.isDelayScroll']" @update:modelValue="updateSetting({ 'desktopLyric.isDelayScroll': $event })" :label="$t('setting__desktop_lyric_delay_scroll')") .gap-top base-checkbox(id="setting_desktop_lyric_alwaysOnTop" :modelValue="appSetting['desktopLyric.isAlwaysOnTop']" @update:modelValue="updateSetting({ 'desktopLyric.isAlwaysOnTop': $event })" :label="$t('setting__desktop_lyric_always_on_top')") + .gap-top + base-checkbox(id="setting_desktop_lyric_showTaskbar" :modelValue="appSetting['desktopLyric.isShowTaskbar']" @update:modelValue="updateSetting({ 'desktopLyric.isShowTaskbar': $event })" :label="$t('setting__desktop_lyric_show_taskbar')") .gap-top base-checkbox(id="setting_desktop_lyric_alwaysOnTopLoop" :modelValue="appSetting['desktopLyric.isAlwaysOnTopLoop']" @update:modelValue="updateSetting({ 'desktopLyric.isAlwaysOnTopLoop': $event })" :label="$t('setting__desktop_lyric_always_on_top_loop')") .gap-top