From c50679ec9e69c1bdf25e16fdd3dcd1eef6d6f607 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 1 Oct 2022 22:52:45 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=A1=8C=E9=9D=A2=E7=AB=AF=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E4=BB=A5=E5=90=8E=E4=BF=9D=E8=AF=81=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E6=9C=80=E5=B0=8F=E5=A4=A7=E5=B0=8F=20Fix=20https://github.com?= =?UTF-8?q?/siyuan-note/siyuan/issues/6041?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/electron/main.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/app/electron/main.js b/app/electron/main.js index 73c27a5ea..67845d9ad 100644 --- a/app/electron/main.js +++ b/app/electron/main.js @@ -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({