mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 13:10:30 +08:00
parent
1d1e712014
commit
f8062e3251
@ -46,6 +46,7 @@
|
|||||||
"electron": "^31.3.1",
|
"electron": "^31.3.1",
|
||||||
"electron-builder": "^25.0.3",
|
"electron-builder": "^25.0.3",
|
||||||
"electron-vite": "^2.3.0",
|
"electron-vite": "^2.3.0",
|
||||||
|
"electron-window-state": "^5.0.3",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-plugin-react": "^7.35.0",
|
"eslint-plugin-react": "^7.35.0",
|
||||||
"framer-motion": "^11.3.21",
|
"framer-motion": "^11.3.21",
|
||||||
|
|||||||
20
pnpm-lock.yaml
generated
20
pnpm-lock.yaml
generated
@ -84,6 +84,9 @@ importers:
|
|||||||
electron-vite:
|
electron-vite:
|
||||||
specifier: ^2.3.0
|
specifier: ^2.3.0
|
||||||
version: 2.3.0(vite@5.3.5(@types/node@22.1.0))
|
version: 2.3.0(vite@5.3.5(@types/node@22.1.0))
|
||||||
|
electron-window-state:
|
||||||
|
specifier: ^5.0.3
|
||||||
|
version: 5.0.3
|
||||||
eslint:
|
eslint:
|
||||||
specifier: ^8.57.0
|
specifier: ^8.57.0
|
||||||
version: 8.57.0
|
version: 8.57.0
|
||||||
@ -2505,6 +2508,10 @@ packages:
|
|||||||
'@swc/core':
|
'@swc/core':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
|
electron-window-state@5.0.3:
|
||||||
|
resolution: {integrity: sha512-1mNTwCfkolXl3kMf50yW3vE2lZj0y92P/HYWFBrb+v2S/pCka5mdwN3cagKm458A7NjndSwijynXgcLWRodsVg==}
|
||||||
|
engines: {node: '>=8.0.0'}
|
||||||
|
|
||||||
electron@31.3.1:
|
electron@31.3.1:
|
||||||
resolution: {integrity: sha512-9fiuWlRhBfygtcT+auRd/WdBK/f8LZZcrpx0RjpXhH2DPTP/PfnkC4JB1PW55qCbGbh4wAgkYbf4ExIag8oGCA==}
|
resolution: {integrity: sha512-9fiuWlRhBfygtcT+auRd/WdBK/f8LZZcrpx0RjpXhH2DPTP/PfnkC4JB1PW55qCbGbh4wAgkYbf4ExIag8oGCA==}
|
||||||
engines: {node: '>= 12.20.55'}
|
engines: {node: '>= 12.20.55'}
|
||||||
@ -3373,6 +3380,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg==}
|
resolution: {integrity: sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg==}
|
||||||
engines: {node: '>= 18'}
|
engines: {node: '>= 18'}
|
||||||
|
|
||||||
|
mkdirp@0.5.6:
|
||||||
|
resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==}
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
mkdirp@1.0.4:
|
mkdirp@1.0.4:
|
||||||
resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==}
|
resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
@ -7886,6 +7897,11 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
|
electron-window-state@5.0.3:
|
||||||
|
dependencies:
|
||||||
|
jsonfile: 4.0.0
|
||||||
|
mkdirp: 0.5.6
|
||||||
|
|
||||||
electron@31.3.1:
|
electron@31.3.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@electron/get': 2.0.3
|
'@electron/get': 2.0.3
|
||||||
@ -8884,6 +8900,10 @@ snapshots:
|
|||||||
minipass: 7.1.2
|
minipass: 7.1.2
|
||||||
rimraf: 5.0.10
|
rimraf: 5.0.10
|
||||||
|
|
||||||
|
mkdirp@0.5.6:
|
||||||
|
dependencies:
|
||||||
|
minimist: 1.2.8
|
||||||
|
|
||||||
mkdirp@1.0.4: {}
|
mkdirp@1.0.4: {}
|
||||||
|
|
||||||
mkdirp@3.0.1: {}
|
mkdirp@3.0.1: {}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
|
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
|
||||||
import { registerIpcMainHandlers } from './utils/ipc'
|
import { registerIpcMainHandlers } from './utils/ipc'
|
||||||
|
import windowStateKeeper from 'electron-window-state'
|
||||||
import { app, shell, BrowserWindow, Menu, dialog, Notification } from 'electron'
|
import { app, shell, BrowserWindow, Menu, dialog, Notification } from 'electron'
|
||||||
import { stopCore } from './core/manager'
|
import { stopCore } from './core/manager'
|
||||||
import { triggerSysProxy } from './resolve/sysproxy'
|
import { triggerSysProxy } from './resolve/sysproxy'
|
||||||
@ -132,11 +133,17 @@ async function handleDeepLink(url: string): Promise<void> {
|
|||||||
export function createWindow(show = false): void {
|
export function createWindow(show = false): void {
|
||||||
Menu.setApplicationMenu(null)
|
Menu.setApplicationMenu(null)
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
|
const mainWindowState = windowStateKeeper({
|
||||||
|
defaultWidth: 800,
|
||||||
|
defaultHeight: 600
|
||||||
|
})
|
||||||
mainWindow = new BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
minWidth: 800,
|
minWidth: 800,
|
||||||
minHeight: 600,
|
minHeight: 600,
|
||||||
width: 800,
|
width: mainWindowState.width,
|
||||||
height: 600,
|
height: mainWindowState.height,
|
||||||
|
x: mainWindowState.x,
|
||||||
|
y: mainWindowState.y,
|
||||||
show: false,
|
show: false,
|
||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
...(process.platform === 'linux' ? { icon: icon } : {}),
|
...(process.platform === 'linux' ? { icon: icon } : {}),
|
||||||
@ -146,6 +153,7 @@ export function createWindow(show = false): void {
|
|||||||
sandbox: false
|
sandbox: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
mainWindowState.manage(mainWindow)
|
||||||
mainWindow.on('ready-to-show', async () => {
|
mainWindow.on('ready-to-show', async () => {
|
||||||
const { silentStart } = await getAppConfig()
|
const { silentStart } = await getAppConfig()
|
||||||
if (!silentStart || show) {
|
if (!silentStart || show) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user