From 17383223f2f8a6891eab340d427aba876c31a851 Mon Sep 17 00:00:00 2001 From: zybug Date: Fri, 4 Feb 2022 16:02:41 +0800 Subject: [PATCH 1/3] Update main.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加macOS 状态栏歌词展示 --- app/main.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/main.js b/app/main.js index 6b8d3fb..a6ca756 100755 --- a/app/main.js +++ b/app/main.js @@ -575,6 +575,14 @@ ipcMain.on("currentLyric", (event, arg) => { floatingWindow.webContents.send("currentLyricTrans", arg.tlyric); } } + // 增加macOS 状态栏歌词展示 + if (process.platform === "darwin") { + if (typeof arg === "string") { + appTray.setTitle(arg) + } else { + appTray.setTitle(arg.lyric) + } + } }); ipcMain.on("trackPlayingNow", (event, track) => { From a6ea31ffe1317f489281cf6bf736961ec8539a66 Mon Sep 17 00:00:00 2001 From: zy Date: Sat, 19 Feb 2022 17:28:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?1=E3=80=81=20=E5=AE=8C=E5=96=84macOS?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=A0=8F=E6=AD=8C=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main.js | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/app/main.js b/app/main.js index a6ca756..8e57a13 100755 --- a/app/main.js +++ b/app/main.js @@ -29,6 +29,9 @@ let mainWindow; let floatingWindow; /** @type {electron.Tray} */ let appTray; +/** enable_status_bar_lyric */ +let showStatusBarLyric; +let currentLyric; //platform-specific switch (process.platform) { case "darwin": @@ -576,12 +579,13 @@ ipcMain.on("currentLyric", (event, arg) => { } } // 增加macOS 状态栏歌词展示 - if (process.platform === "darwin") { - if (typeof arg === "string") { - appTray.setTitle(arg) - } else { - appTray.setTitle(arg.lyric) - } + if (typeof arg === "string") { + currentLyric = arg + } else { + currentLyric = arg.lyric + } + if (process.platform === "darwin" && showStatusBarLyric) { + appTray.setTitle(currentLyric) } }); @@ -613,6 +617,16 @@ ipcMain.on("control", async (event, arg, params) => { floatingWindow?.hide(); break; + case "enable_status_bar_lyric": + appTray.setTitle(currentLyric) + showStatusBarLyric = true + break; + + case "disable_status_bar_lyric": + appTray.setTitle("") + showStatusBarLyric = false + break; + case "window_min": mainWindow.minimize(); break; From 5f8188ba134d485c0f7b688ac43a75fe4a880832 Mon Sep 17 00:00:00 2001 From: zy Date: Sat, 19 Feb 2022 18:17:21 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fixup!=201=E3=80=81=20=E5=AE=8C=E5=96=84mac?= =?UTF-8?q?OS=E7=8A=B6=E6=80=81=E6=A0=8F=E6=AD=8C=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/listen1_chrome_extension | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/listen1_chrome_extension b/app/listen1_chrome_extension index 445b329..1970d89 160000 --- a/app/listen1_chrome_extension +++ b/app/listen1_chrome_extension @@ -1 +1 @@ -Subproject commit 445b3293f62ccf45b514eca35fa14c63a051810f +Subproject commit 1970d896786c1db38866ecf9d94172fcae3c1c96