add --maximize and --start-to-tray options
This commit is contained in:
10
bin/cli.ts
vendored
10
bin/cli.ts
vendored
@@ -99,6 +99,11 @@ program
|
||||
.default(DEFAULT.alwaysOnTop)
|
||||
.hideHelp(),
|
||||
)
|
||||
.addOption(
|
||||
new Option('--maximize', 'Start window maximized')
|
||||
.default(DEFAULT.maximize)
|
||||
.hideHelp(),
|
||||
)
|
||||
.addOption(
|
||||
new Option('--dark-mode', 'Force Mac app to use dark mode')
|
||||
.default(DEFAULT.darkMode)
|
||||
@@ -164,6 +169,11 @@ program
|
||||
.default(DEFAULT.multiInstance)
|
||||
.hideHelp(),
|
||||
)
|
||||
.addOption(
|
||||
new Option('--start-to-tray', 'Start app minimized to tray')
|
||||
.default(DEFAULT.startToTray)
|
||||
.hideHelp(),
|
||||
)
|
||||
.addOption(
|
||||
new Option('--installer-language <string>', 'Installer language')
|
||||
.default(DEFAULT.installerLanguage)
|
||||
|
||||
2
bin/defaults.ts
vendored
2
bin/defaults.ts
vendored
@@ -5,6 +5,7 @@ export const DEFAULT_PAKE_OPTIONS: PakeCliOptions = {
|
||||
height: 780,
|
||||
width: 1200,
|
||||
fullscreen: false,
|
||||
maximize: false,
|
||||
resizable: true,
|
||||
hideTitleBar: false,
|
||||
alwaysOnTop: false,
|
||||
@@ -28,6 +29,7 @@ export const DEFAULT_PAKE_OPTIONS: PakeCliOptions = {
|
||||
enableDragDrop: false,
|
||||
keepBinary: false,
|
||||
multiInstance: false,
|
||||
startToTray: false,
|
||||
};
|
||||
|
||||
// Just for cli development
|
||||
|
||||
4
bin/helpers/merge.ts
vendored
4
bin/helpers/merge.ts
vendored
@@ -49,6 +49,7 @@ export async function mergeConfig(
|
||||
width,
|
||||
height,
|
||||
fullscreen,
|
||||
maximize,
|
||||
hideTitleBar,
|
||||
alwaysOnTop,
|
||||
appVersion,
|
||||
@@ -71,6 +72,7 @@ export async function mergeConfig(
|
||||
wasm,
|
||||
enableDragDrop,
|
||||
multiInstance,
|
||||
startToTray,
|
||||
} = options;
|
||||
|
||||
const { platform } = process;
|
||||
@@ -81,6 +83,7 @@ export async function mergeConfig(
|
||||
width,
|
||||
height,
|
||||
fullscreen,
|
||||
maximize,
|
||||
resizable,
|
||||
hide_title_bar: hideTitleBar,
|
||||
activation_shortcut: activationShortcut,
|
||||
@@ -92,6 +95,7 @@ export async function mergeConfig(
|
||||
title: title || null,
|
||||
enable_wasm: wasm,
|
||||
enable_drag_drop: enableDragDrop,
|
||||
start_to_tray: startToTray && showSystemTray,
|
||||
};
|
||||
Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });
|
||||
|
||||
|
||||
6
bin/types.ts
vendored
6
bin/types.ts
vendored
@@ -24,6 +24,9 @@ export interface PakeCliOptions {
|
||||
// Whether the window can be fullscreen, default false
|
||||
fullscreen: boolean;
|
||||
|
||||
// Start window maximized, default false
|
||||
maximize: boolean;
|
||||
|
||||
// Enable immersive header, default false.
|
||||
hideTitleBar: boolean;
|
||||
|
||||
@@ -90,6 +93,9 @@ export interface PakeCliOptions {
|
||||
|
||||
// Allow multiple instances, default false (single instance)
|
||||
multiInstance: boolean;
|
||||
|
||||
// Start app minimized to tray, default false
|
||||
startToTray: boolean;
|
||||
}
|
||||
|
||||
export interface PakeAppOptions extends PakeCliOptions {
|
||||
|
||||
Reference in New Issue
Block a user