mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 桌面端重启以后保证窗口最小大小 Fix https://github.com/siyuan-note/siyuan/issues/6041
This commit is contained in:
parent
149ad91383
commit
c50679ec9e
1 changed files with 8 additions and 10 deletions
|
|
@ -84,10 +84,8 @@ try {
|
|||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
require('electron').
|
||||
dialog.
|
||||
showErrorBox('创建配置目录失败 Failed to create config directory',
|
||||
'思源需要在用户家目录下创建配置文件夹(~/.config/siyuan),请确保该路径具有写入权限。\n\nSiYuan needs to create a configuration folder (~/.config/siyuan) in the user\'s home directory. Please make sure that the path has write permissions.')
|
||||
require('electron').dialog.showErrorBox('创建配置目录失败 Failed to create config directory',
|
||||
'思源需要在用户家目录下创建配置文件夹(~/.config/siyuan),请确保该路径具有写入权限。\n\nSiYuan needs to create a configuration folder (~/.config/siyuan) in the user\'s home directory. Please make sure that the path has write permissions.')
|
||||
app.exit()
|
||||
}
|
||||
|
||||
|
|
@ -151,12 +149,6 @@ const boot = () => {
|
|||
windowState.width = Math.min(defaultWidth, workArea.width)
|
||||
windowState.height = Math.min(defaultHeight, workArea.height)
|
||||
}
|
||||
if (windowState.width < 256) {
|
||||
windowState.width = Math.min(defaultWidth, workArea.width)
|
||||
}
|
||||
if (windowState.height < 256) {
|
||||
windowState.height = Math.min(defaultHeight, workArea.height)
|
||||
}
|
||||
if (x > workArea.width || x < 0) {
|
||||
x = 0
|
||||
}
|
||||
|
|
@ -164,6 +156,12 @@ const boot = () => {
|
|||
y = 0
|
||||
}
|
||||
}
|
||||
if (windowState.width < 400) {
|
||||
windowState.width = 400
|
||||
}
|
||||
if (windowState.height < 300) {
|
||||
windowState.height = 300
|
||||
}
|
||||
|
||||
// 创建主窗体
|
||||
mainWindow = new BrowserWindow({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue