From 5d1b1e48d7d1484d6f44d2d16fe48e5cf8e2ae42 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Mon, 2 Dec 2024 00:07:00 +0800 Subject: [PATCH] =?UTF-8?q?Windows=20=E4=B8=8B=E6=94=B9=E7=94=A8=E5=8E=9F?= =?UTF-8?q?=E7=94=9F=E7=AA=97=E5=8F=A3=E8=B0=83=E6=95=B4=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=EF=BC=88#2137=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 1 + src/main/modules/winLyric/main.ts | 3 ++- src/renderer-lyric/App.vue | 19 +++++++++++-------- src/renderer-lyric/index.html | 3 ++- src/renderer-lyric/types/app.d.ts | 1 + 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index e0a87704..d8925868 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -13,6 +13,7 @@ Linux 系统至少需要 GLIBC_2.29 版本才能运行, - 优化正常播放结束时的下一首歌曲播放衔接度,在歌曲即将播放结束时将预获取下一首歌曲的播放链接,减少自动切歌时的等待时间(#2126) - 优化歌曲换源机制,提升换源正确率 +- 优化 Windows 下桌面歌词窗口大小调整机制,Windows 下改用原生窗口调整方式(#2137) - 修正搜索歌曲提示框文案(#2050) - 优化播放详情页UI,歌曲名字、歌手等文字过长时被截断的问题(#2049) - Scheme URL 的播放歌曲允许更长的专辑名称 diff --git a/src/main/modules/winLyric/main.ts b/src/main/modules/winLyric/main.ts index a76ac699..5c7c407f 100644 --- a/src/main/modules/winLyric/main.ts +++ b/src/main/modules/winLyric/main.ts @@ -55,6 +55,7 @@ const winEvent = () => { browserWindow.on('resize', () => { // bounds = browserWindow.getBounds() // console.log(bounds) + isWinBoundsUpdateing = true const bounds = browserWindow!.getBounds() saveBoundsConfig({ 'desktopLyric.x': bounds.x, @@ -122,7 +123,7 @@ export const createWindow = () => { hasShadow: false, // enableRemoteModule: false, // icon: join(global.__static, isWin ? 'icons/256x256.ico' : 'icons/512x512.png'), - resizable: false, + resizable: isWin, minimizable: false, maximizable: false, fullscreenable: false, diff --git a/src/renderer-lyric/App.vue b/src/renderer-lyric/App.vue index d4695652..66fcf1cf 100644 --- a/src/renderer-lyric/App.vue +++ b/src/renderer-lyric/App.vue @@ -12,14 +12,16 @@ -
-
-
-
-
-
-
-
+
@@ -35,6 +37,7 @@ import useLyric from '@lyric/useApp/useLyric' import useTheme from '@lyric/useApp/useTheme' import { init as initLyricPlayer } from '@lyric/core/lyric' +const isShowResize = window.os != 'windows' useCommon() const { handleMouseDown, handleTouchDown } = useWindowSize() const { handleMouseMoveMain, isHoverHide, isMouseEnter } = useHoverHide() diff --git a/src/renderer-lyric/index.html b/src/renderer-lyric/index.html index 22e03814..59ae47be 100644 --- a/src/renderer-lyric/index.html +++ b/src/renderer-lyric/index.html @@ -17,7 +17,8 @@ document.documentElement.setAttribute('lang', formatLang(lang)) } window.setLang() - document.documentElement.classList.add(/os=(\w+)/.exec(window.location.search)[1]) + window.os = /os=(\w+)/.exec(window.location.search)[1] + document.documentElement.classList.add(window.os) window.dom_style_theme = document.createElement('style') window.dom_style_lyric = document.createElement('style') diff --git a/src/renderer-lyric/types/app.d.ts b/src/renderer-lyric/types/app.d.ts index 64fdadf7..a75802b6 100644 --- a/src/renderer-lyric/types/app.d.ts +++ b/src/renderer-lyric/types/app.d.ts @@ -11,6 +11,7 @@ declare global { setTheme: (colors: Record) => void setLang: (lang?: string) => void setLyricColor: (colors: Record) => void + os: 'windows' | 'linux' | 'mac' } namespace LX {