mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-28 05:11:24 +08:00
fix: replace hardcoded window size on first start (#9669)
* fix: replace hardcoded window size on first start Signed-off-by: dev <verc20.dev@proton.me> * fix: change MIN_WINDOW_WIDTH from 1080 to 960 --------- Signed-off-by: dev <verc20.dev@proton.me>
This commit is contained in:
parent
86635eef49
commit
8f5e89d69a
@ -207,7 +207,7 @@ export const defaultTimeout = 10 * 1000 * 60
|
||||
|
||||
export const occupiedDirs = ['logs', 'Network', 'Partitions/webview/Network']
|
||||
|
||||
export const MIN_WINDOW_WIDTH = 1080
|
||||
export const MIN_WINDOW_WIDTH = 960
|
||||
export const SECOND_MIN_WINDOW_WIDTH = 520
|
||||
export const MIN_WINDOW_HEIGHT = 600
|
||||
export const defaultByPassRules = 'localhost,127.0.0.1,::1'
|
||||
|
||||
@ -5,6 +5,7 @@ import { is } from '@electron-toolkit/utils'
|
||||
import { loggerService } from '@logger'
|
||||
import { isDev, isLinux, isMac, isWin } from '@main/constant'
|
||||
import { getFilesDir } from '@main/utils/file'
|
||||
import { MIN_WINDOW_HEIGHT, MIN_WINDOW_WIDTH } from '@shared/config/constant'
|
||||
import { IpcChannel } from '@shared/IpcChannel'
|
||||
import { app, BrowserWindow, nativeTheme, screen, shell } from 'electron'
|
||||
import windowStateKeeper from 'electron-window-state'
|
||||
@ -47,8 +48,8 @@ export class WindowService {
|
||||
}
|
||||
|
||||
const mainWindowState = windowStateKeeper({
|
||||
defaultWidth: 960,
|
||||
defaultHeight: 600,
|
||||
defaultWidth: MIN_WINDOW_WIDTH,
|
||||
defaultHeight: MIN_WINDOW_HEIGHT,
|
||||
fullScreen: false,
|
||||
maximize: false
|
||||
})
|
||||
@ -58,8 +59,8 @@ export class WindowService {
|
||||
y: mainWindowState.y,
|
||||
width: mainWindowState.width,
|
||||
height: mainWindowState.height,
|
||||
minWidth: 960,
|
||||
minHeight: 600,
|
||||
minWidth: MIN_WINDOW_WIDTH,
|
||||
minHeight: MIN_WINDOW_HEIGHT,
|
||||
show: false,
|
||||
autoHideMenuBar: true,
|
||||
transparent: false,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user