From 88e4df43889bc3ab46fb92282a2c643d0d3dab97 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Tue, 28 Jan 2025 19:49:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Windows=20=E4=B8=8B?= =?UTF-8?q?=E6=A1=8C=E9=9D=A2=E6=AD=8C=E8=AF=8D=E6=9C=80=E5=B0=8F=E9=AB=98?= =?UTF-8?q?=E5=BA=A6=E8=AE=BE=E7=BD=AE=E9=97=AE=E9=A2=98=EF=BC=88#2244?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 64 +------------------ src/main/modules/winLyric/main.ts | 2 +- src/main/modules/winLyric/utils.ts | 10 +-- .../layout/LyricHorizontal/useLyric.js | 23 +++++-- 4 files changed, 25 insertions(+), 74 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 6fe0ad1d..b9211cb8 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,65 +1,3 @@ -落雪祝大家新年快乐! - -### 关于之前提到的新项目 - -新项目我取名叫 Any Listen,希望它能像它的名字一样让我们能到处任意听歌。 -经过一年多的开发,因各种原因,实际进度比预期的慢,但还是赶在年前发布了第一个web服务预览版,第一个版本仅支持播放服务器上的歌曲,扩展功能暂时未能开放,但已趋于完成,一两个月内可以搞定。 -目前的版本仅是“能用”的状态,因时间关系,部分UI未能重新设计,但后面会继续完善。 -该项目目前的目标用户是拥有自己服务器且上面存储有歌曲的人使用。 - -项目刚发布,文档未能完善,遇到使用问题或有任何建议欢迎提 issue 交流, -项目地址: https://github.com/any-listen/any-listen - ---- - -*感谢 @3gf8jv4dv 对 LX 系列项目翻译、文档等文案的大幅修订优化。* - -### 不兼容性变更 - -Linux 系统至少需要 `GLIBC_2.29` 版本才能运行。 - -由于将 Electron 升级到 v32.x,原生库的编译被限制到不低于 C++ 20,试了几次无法在 docker 镜像 `node:16` 安装 gcc-10,最终将构建使用镜像更新到 `node:18`。 - -### 新增 - -- 新增下载的歌曲按列表名分组的功能,默认关闭,可以通过「设置 → 下载设置 → 将文件保存到以对应列表命名的子目录中」启用(#2145) -- 新增托盘图标样式「跟随系统亮暗模式」设置,可以在「设置 → 其他」里启用 (#2016) -- 支持本地同名 `.krc` 格式歌词文件的读取(#2053) -- 开放 API 新增播放器播放/暂停、切歌、收藏当前播放歌曲等接口调用,详情看文档「开放 API 服务」部分(#2077, @14Kay) - -### 优化 - -- 优化正常播放结束时的下一首歌曲播放衔接度,在歌曲即将结束播放时将预获取下一首歌曲的播放链接,减少自动切歌时的等待时间(#2126) -- 优化歌曲换源机制,提升换源正确率 -- 优化 Windows 平台上桌面歌词窗口大小调整机制,改用原生的窗口调整方式(#2137) -- 修正搜索歌曲提示框文案(#2050) -- 优化播放详情页 UI,修复「歌曲名」「艺术家」等文字过长时被截断的问题(#2049) -- Scheme URL 的播放歌曲允许更长的专辑名称 -- 播放本地歌曲时,将优先尝试读取本地同名 `.jpg` 或 `.png` 图片作为播放封面显示,若文件不存在则从音频文件内读取,最后再尝试使用在线图片(#2096) -- 客户端模式的同步服务连接允许重定向 5 次(#2109) -- 更新软件默认使用的字体,修复 macOS Sequoia (15) 上界面出现乱码的问题(#2076) -- 优化简体、繁体中文文案编排,大幅修订英语文案编排(#2159, #2166, #2174 等, @3gf8jv4dv) -- 优化排序歌曲、主题名称、添加/编辑主题、列表更新管理等对话框布局及长文本显示效果(#2176, #2188, #2189, #2198 等, @3gf8jv4dv) - ### 修复 -- 修复歌单详情页内歌单名字过长时的 UI 显示问题(#2028) -- 修复获取自定义环境音效预设列表逻辑问题 -- 修复 `.m4a` 文件内嵌歌词无法读取的问题(#2090) -- 修复 Windows 任务管理器中的进程名显示为软件描述的问题(#2147) -- 修复本地歌曲同名歌词文件调整偏移时间后,下次再播放时调整的设置未被应用的问题(#2139) -- 修复首次打开软件后直接创建并删除列表时的报错问题(#2175, @14Kay) - -### 变更 - -- 不再长期缓存换源歌曲信息 -- 更新软件默认使用的字体,现在软件尽量使用系统自带的默认字体 -- Linux 系统至少需要 `GLIBC_2.29` 版本才能运行 - -### 其他 - -- 更新 Readme 文档,优化文案编排(#2146, Thanks @3gf8jv4dv) -- 更新 Issue 模板(#2153, @3gf8jv4dv) -- 更新项目文档(@3gf8jv4dv) -- 修订项目协议文件(#2146, #2152, @3gf8jv4dv) -- 更新 Electron 到 v32.3.0 +- 修复 Windows 下桌面歌词最小高度设置问题(#2244) diff --git a/src/main/modules/winLyric/main.ts b/src/main/modules/winLyric/main.ts index 5c7c407f..5ee4a4dd 100644 --- a/src/main/modules/winLyric/main.ts +++ b/src/main/modules/winLyric/main.ts @@ -116,7 +116,7 @@ export const createWindow = () => { x: winSize.x, y: winSize.y, minWidth: 380, - minHeight: 80, + minHeight: 38, useContentSize: true, frame: false, transparent: true, diff --git a/src/main/modules/winLyric/utils.ts b/src/main/modules/winLyric/utils.ts index 722e62eb..0c1bfbb7 100644 --- a/src/main/modules/winLyric/utils.ts +++ b/src/main/modules/winLyric/utils.ts @@ -1,6 +1,6 @@ // 设置窗口位置、大小 export let minWidth = 80 -export let minHeight = 50 +export let minHeight = 38 // const updateBounds = (bounds: Bounds) => { @@ -14,9 +14,11 @@ export let minHeight = 50 * @param param 新设置(相对于当前设置) * @returns */ -export const getLyricWindowBounds = (bounds: Electron.Rectangle, { x = 0, y = 0, w = 0, h = 0 }: LX.DesktopLyric.NewBounds): Electron.Rectangle => { - if (w < minWidth) w = minWidth - if (h < minHeight) h = minHeight +export const getLyricWindowBounds = (bounds: Electron.Rectangle, { x = 0, y = 0, w, h }: LX.DesktopLyric.NewBounds): Electron.Rectangle => { + if (w == 0) w = bounds.width + else if (w < minWidth) w = minWidth + if (h == 0) h = bounds.height + else if (h < minHeight) h = minHeight if (global.lx.appSetting['desktopLyric.isLockScreen']) { if (!global.envParams.workAreaSize) return bounds diff --git a/src/renderer-lyric/components/layout/LyricHorizontal/useLyric.js b/src/renderer-lyric/components/layout/LyricHorizontal/useLyric.js index 10336722..1b00049b 100644 --- a/src/renderer-lyric/components/layout/LyricHorizontal/useLyric.js +++ b/src/renderer-lyric/components/layout/LyricHorizontal/useLyric.js @@ -3,6 +3,7 @@ import { scrollTo } from '@common/utils/renderer' import { lyric } from '@lyric/store/lyric' import { isPlay, setting } from '@lyric/store/state' import { setWindowBounds } from '@lyric/utils/ipc' +import { isWin } from '@common/utils' const getOffsetTop = (contentHeight, lineHeight) => { switch (setting['desktopLyric.scrollAlign']) { @@ -108,12 +109,22 @@ export default (isComputeHeight) => { dom_lyric.value.scrollTop = msDownScrollY + msDownY - y startLyricScrollTimeout() } else if (winEvent.isMsDown) { - setWindowBounds({ - x: x - winEvent.msDownX, - y: y - winEvent.msDownY, - w: window.innerWidth, - h: window.innerHeight, - }) + // https://github.com/lyswhut/lx-music-desktop/issues/2244 + if (isWin) { + setWindowBounds({ + x: x - winEvent.msDownX, + y: y - winEvent.msDownY, + w: 0, + h: 0, + }) + } else { + setWindowBounds({ + x: x - winEvent.msDownX, + y: y - winEvent.msDownY, + w: window.innerWidth, + h: window.innerHeight, + }) + } } } const handleMouseMsMove = event => {