Feature: manual page now open in a new window

This commit is contained in:
萌萌哒赫萝
2023-09-12 00:31:41 -07:00
parent d776600df9
commit b197b32935
6 changed files with 52 additions and 7 deletions
+4
View File
@@ -19,3 +19,7 @@ export const RENAME_WINDOW_URL = process.env.NODE_ENV === 'development'
export const TOOLBOX_WINDOW_URL = process.env.NODE_ENV === 'development'
? `${(process.env.WEBPACK_DEV_SERVER_URL as string)}#toolbox-page`
: 'picgo://./index.html#toolbox-page'
export const MANUAL_WINDOW_URL = process.env.NODE_ENV === 'development'
? `${(process.env.WEBPACK_DEV_SERVER_URL as string)}#documents`
: 'picgo://./index.html#documents'
+33 -1
View File
@@ -13,7 +13,8 @@ import {
TRAY_WINDOW_URL,
MINI_WINDOW_URL,
RENAME_WINDOW_URL,
TOOLBOX_WINDOW_URL
TOOLBOX_WINDOW_URL,
MANUAL_WINDOW_URL
} from './constants'
// Custom types/enums
@@ -57,6 +58,27 @@ const trayWindowOptions = {
}
}
const manualWindowOptions = {
height: 800,
width: 1200,
show: false,
frame: true,
center: true,
fullscreenable: true,
resizable: true,
title: 'Manual',
vibrancy: 'ultra-dark',
transparent: false,
webPreferences: {
webviewTag: true,
backgroundThrottling: false,
nodeIntegration: !!process.env.ELECTRON_NODE_INTEGRATION,
contextIsolation: !process.env.ELECTRON_NODE_INTEGRATION,
nodeIntegrationInWorker: true,
webSecurity: false
}
} as IBrowserWindowOptions
const settingWindowOptions = {
height: defaultWindowHeight,
width: defaultWindowWidth,
@@ -169,6 +191,16 @@ windowList.set(IWindowList.TRAY_WINDOW, {
}
})
windowList.set(IWindowList.MANUAL_WINDOW, {
isValid: true,
multiple: false,
options: () => manualWindowOptions,
callback (window) {
window.loadURL(handleWindowParams(MANUAL_WINDOW_URL))
window.focus()
}
})
windowList.set(IWindowList.SETTING_WINDOW, {
isValid: true,
multiple: false,