新增 不允许将歌词窗口拖出主屏幕之外 的设置项

This commit is contained in:
lyswhut
2020-08-23 12:13:17 +08:00
parent 44acc7d5ac
commit c15895ab45
10 changed files with 87 additions and 51 deletions
+6 -2
View File
@@ -80,14 +80,18 @@ const createWindow = () => {
x = screenWidth - width - offset
y = screenHeight - height - offset
}
if (global.appSetting.desktopLyric.isLockScreen) {
x = Math.max(-offset, screenWidth < (width + x) ? screenWidth - width : x)
y = Math.max(-offset, screenHeight < (height + y) ? screenHeight - height : y)
}
/**
* Initial window options
*/
global.modules.lyricWindow = new BrowserWindow({
height: Math.max(height > screenHeight ? screenHeight : height, 80),
width: Math.max(width > screenWidth ? screenWidth : width, 380),
x: Math.max(-offset, screenWidth < (width + x) ? screenWidth - width : x),
y: Math.max(-offset, screenHeight < (height + y) ? screenHeight - height : y),
x,
y,
minWidth: 380,
minHeight: 80,
useContentSize: true,