mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-07 22:10:21 +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 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 SECOND_MIN_WINDOW_WIDTH = 520
|
||||||
export const MIN_WINDOW_HEIGHT = 600
|
export const MIN_WINDOW_HEIGHT = 600
|
||||||
export const defaultByPassRules = 'localhost,127.0.0.1,::1'
|
export const defaultByPassRules = 'localhost,127.0.0.1,::1'
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import { is } from '@electron-toolkit/utils'
|
|||||||
import { loggerService } from '@logger'
|
import { loggerService } from '@logger'
|
||||||
import { isDev, isLinux, isMac, isWin } from '@main/constant'
|
import { isDev, isLinux, isMac, isWin } from '@main/constant'
|
||||||
import { getFilesDir } from '@main/utils/file'
|
import { getFilesDir } from '@main/utils/file'
|
||||||
|
import { MIN_WINDOW_HEIGHT, MIN_WINDOW_WIDTH } from '@shared/config/constant'
|
||||||
import { IpcChannel } from '@shared/IpcChannel'
|
import { IpcChannel } from '@shared/IpcChannel'
|
||||||
import { app, BrowserWindow, nativeTheme, screen, shell } from 'electron'
|
import { app, BrowserWindow, nativeTheme, screen, shell } from 'electron'
|
||||||
import windowStateKeeper from 'electron-window-state'
|
import windowStateKeeper from 'electron-window-state'
|
||||||
@ -47,8 +48,8 @@ export class WindowService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const mainWindowState = windowStateKeeper({
|
const mainWindowState = windowStateKeeper({
|
||||||
defaultWidth: 960,
|
defaultWidth: MIN_WINDOW_WIDTH,
|
||||||
defaultHeight: 600,
|
defaultHeight: MIN_WINDOW_HEIGHT,
|
||||||
fullScreen: false,
|
fullScreen: false,
|
||||||
maximize: false
|
maximize: false
|
||||||
})
|
})
|
||||||
@ -58,8 +59,8 @@ export class WindowService {
|
|||||||
y: mainWindowState.y,
|
y: mainWindowState.y,
|
||||||
width: mainWindowState.width,
|
width: mainWindowState.width,
|
||||||
height: mainWindowState.height,
|
height: mainWindowState.height,
|
||||||
minWidth: 960,
|
minWidth: MIN_WINDOW_WIDTH,
|
||||||
minHeight: 600,
|
minHeight: MIN_WINDOW_HEIGHT,
|
||||||
show: false,
|
show: false,
|
||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
transparent: false,
|
transparent: false,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user