diff --git a/publish/changeLog.md b/publish/changeLog.md index 0bf49f11..de5fa76c 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -6,6 +6,7 @@ ### 优化 - Windows、MacOS平台下的字体列表改用原生方式获取,现在Windows平台下能显示当前已安装的更多类型字体了(注:MacOS平台未测,可用性未知) +- 移除桌面歌词窗口透明边距,在Linux下的桌面歌词可以完全拖到贴合屏幕边缘了 ### 修复 diff --git a/src/main/modules/winLyric/utils.ts b/src/main/modules/winLyric/utils.ts index ddf06b2f..722e62eb 100644 --- a/src/main/modules/winLyric/utils.ts +++ b/src/main/modules/winLyric/utils.ts @@ -1,5 +1,4 @@ // 设置窗口位置、大小 -export const padding = 8 export let minWidth = 80 export let minHeight = 50 @@ -21,25 +20,23 @@ export const getLyricWindowBounds = (bounds: Electron.Rectangle, { x = 0, y = 0, if (global.lx.appSetting['desktopLyric.isLockScreen']) { if (!global.envParams.workAreaSize) return bounds - const maxWinW = global.envParams.workAreaSize.width + padding * 2 - const maxWinH = global.envParams.workAreaSize.height + padding * 2 + const maxWinW = global.envParams.workAreaSize.width + const maxWinH = global.envParams.workAreaSize.height if (w > maxWinW) w = maxWinW if (h > maxWinH) h = maxWinH - const maxX = global.envParams.workAreaSize.width + padding - w - const minX = -padding - const maxY = global.envParams.workAreaSize.height + padding - h - const minY = -padding + const maxX = global.envParams.workAreaSize.width - w + const maxY = global.envParams.workAreaSize.height - h x += bounds.x y += bounds.y if (x > maxX) x = maxX - else if (x < minX) x = minX + else if (x < 0) x = 0 if (y > maxY) y = maxY - else if (y < minY) y = minY + else if (y < 0) y = 0 } else { y += bounds.y x += bounds.x @@ -101,10 +98,10 @@ export const initWindowSize = (x: LX.AppSetting['desktopLyric.x'], y: LX.AppSett if (width < minWidth) width = minWidth if (height < minHeight) height = minHeight if (global.envParams.workAreaSize) { - x = global.envParams.workAreaSize.width + padding - width - y = global.envParams.workAreaSize.height + padding - height + x = global.envParams.workAreaSize.width - width + y = global.envParams.workAreaSize.height - height } else { - x = y = -padding + x = y = 0 } } else { let bounds = getLyricWindowBounds({ x, y, width, height }, { x: 0, y: 0, w: width, h: height }) diff --git a/src/renderer-lyric/App.vue b/src/renderer-lyric/App.vue index 1703b4b7..38811302 100644 --- a/src/renderer-lyric/App.vue +++ b/src/renderer-lyric/App.vue @@ -12,14 +12,14 @@ -
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -70,7 +70,6 @@ body { } #container { - padding: 8px; box-sizing: border-box; height: 100%; transition: opacity .3s ease; @@ -85,12 +84,16 @@ body { } } +@resize-width: 6px; +.resize { + z-index: 2; +} .resize-left { position: absolute; left: 0; top: 0; height: 100%; - width: 10px; + width: @resize-width; cursor: ew-resize; // background-color: rgba(0, 0, 0, 1); } @@ -99,14 +102,14 @@ body { right: 0; top: 0; height: 100%; - width: 10px; + width: @resize-width; cursor: ew-resize; } .resize-top { position: absolute; left: 0; top: 0; - height: 10px; + height: 4px; width: 100%; cursor: ns-resize; } @@ -114,7 +117,7 @@ body { position: absolute; left: 0; bottom: 0; - height: 10px; + height: @resize-width; width: 100%; cursor: ns-resize; } @@ -122,8 +125,8 @@ body { position: absolute; left: 0; top: 0; - width: 14px; - height: 14px; + width: @resize-width; + height: @resize-width; cursor: nwse-resize; // background-color: rgba(0, 0, 0, 1); } @@ -131,26 +134,17 @@ body { position: absolute; right: 0; top: 0; - width: 14px; - height: 14px; + width: @resize-width; + height: @resize-width; cursor: nesw-resize; // background-color: rgba(0, 0, 0, 1); } -.resize-top-left { - position: absolute; - left: 0; - top: 0; - width: 14px; - height: 14px; - cursor: nwse-resize; - // background-color: rgba(0, 0, 0, 1); -} .resize-bottom-left { position: absolute; left: 0; bottom: 0; - width: 14px; - height: 14px; + width: @resize-width; + height: @resize-width; cursor: nesw-resize; // background-color: rgba(0, 0, 0, 1); } @@ -158,8 +152,8 @@ body { position: absolute; right: 0; bottom: 0; - width: 14px; - height: 14px; + width: @resize-width; + height: @resize-width; cursor: nwse-resize; // background-color: rgba(0, 0, 0, 1); }