mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
feat: add 'hide-main-window-on-startup' configuration item
This commit is contained in:
+5
-1
@@ -234,7 +234,11 @@ const createWindow = () => {
|
||||
win && win.loadURL(getUrl())
|
||||
restoreWindowBounds()
|
||||
win.on('ready-to-show', () => {
|
||||
win!.show()
|
||||
if (config.get('hide-main-window-on-startup', false)) {
|
||||
hideWindow()
|
||||
} else {
|
||||
win!.show()
|
||||
}
|
||||
skipBeforeUnloadCheck = false
|
||||
})
|
||||
|
||||
|
||||
@@ -322,6 +322,14 @@ const schema: SettingSchema = ({
|
||||
format: 'checkbox',
|
||||
required: true,
|
||||
},
|
||||
'hide-main-window-on-startup': {
|
||||
defaultValue: false,
|
||||
title: 'T_setting-panel.schema.hide-main-window-on-startup',
|
||||
type: 'boolean',
|
||||
group: 'other',
|
||||
format: 'checkbox',
|
||||
required: true,
|
||||
},
|
||||
envs: {
|
||||
defaultValue: '',
|
||||
title: 'T_setting-panel.schema.envs',
|
||||
|
||||
@@ -326,6 +326,7 @@ export interface BuildInSettings {
|
||||
'extension.registry': RegistryHostname,
|
||||
'extension.auto-upgrade': boolean,
|
||||
'keep-running-after-closing-window': boolean,
|
||||
'hide-main-window-on-startup': boolean,
|
||||
'plantuml-api': string,
|
||||
}
|
||||
|
||||
|
||||
@@ -432,6 +432,7 @@ const data = {
|
||||
'replace-placeholder': '%foo% -> BAR',
|
||||
},
|
||||
'hide-main-window-on-startup': 'Hide Main Window on Startup',
|
||||
'keep-running-after-closing-window': 'Keep Running after Closing Window',
|
||||
}
|
||||
},
|
||||
'quick-open': {
|
||||
|
||||
@@ -423,6 +423,7 @@ const data: BaseLanguage = {
|
||||
'replace-placeholder': '%foo% -> BAR',
|
||||
},
|
||||
'keep-running-after-closing-window': '关闭窗口后保持运行',
|
||||
'hide-main-window-on-startup': '启动时隐藏主窗口',
|
||||
},
|
||||
'tabs': {
|
||||
'repos': '仓库',
|
||||
|
||||
Reference in New Issue
Block a user