🐛 Remove transparent and use hideTitleBar

This commit is contained in:
Tw93
2024-05-09 20:50:11 +08:00
parent 4df5a667d7
commit 3473db7312
15 changed files with 59 additions and 45 deletions

View File

@@ -107,7 +107,8 @@ export default abstract class BaseBuilder {
}
protected getBasePath(): string {
return 'src-tauri/target/release/bundle/';
const basePath = this.options.debug ? 'debug' : 'release';
return `src-tauri/target/${basePath}/bundle/`;
}
protected getBuildAppPath(npmDirectory: string, fileName: string, fileType: string): string {

3
bin/cli.ts vendored
View File

@@ -30,7 +30,7 @@ program
.option('--width <number>', 'Window width', validateNumberInput, DEFAULT.width)
.option('--height <number>', 'Window height', validateNumberInput, DEFAULT.height)
.option('--fullscreen', 'Start in full screen', DEFAULT.fullscreen)
.option('--hide-title-bar', 'Only for Mac, hide title bar', DEFAULT.transparent)
.option('--hide-title-bar', 'Only for Mac, hide title bar', DEFAULT.hideTitleBar)
.option('--activation-shortcut <string>', 'Shortcut key to active App', DEFAULT.activationShortcut)
.option('--multi-arch', 'Only for Mac, supports both Intel and M1', DEFAULT.multiArch)
.option('--inject [injects...]', 'Injection of .js or .css Files', DEFAULT.inject)
@@ -42,7 +42,6 @@ program
.addOption(new Option('--disabled-web-shortcuts', 'Disabled webPage shortcuts').default(DEFAULT.disabledWebShortcuts).hideHelp())
.addOption(new Option('--show-system-tray', 'Show system tray in app').default(DEFAULT.showSystemTray).hideHelp())
.addOption(new Option('--system-tray-icon <string>', 'Custom system tray icon').default(DEFAULT.systemTrayIcon).hideHelp())
.addOption(new Option('--transparent', 'Only for Mac, hide title bar').default(DEFAULT.transparent).hideHelp())
.version(packageJson.version, '-v, --version', 'Output the current version')
.action(async (url: string, options: PakeCliOptions) => {
await checkUpdateTips();

10
bin/defaults.ts vendored
View File

@@ -6,7 +6,7 @@ export const DEFAULT_PAKE_OPTIONS: PakeCliOptions = {
width: 1200,
fullscreen: false,
resizable: true,
transparent: false,
hideTitleBar: false,
alwaysOnTop: false,
disabledWebShortcuts: false,
activationShortcut: '',
@@ -22,10 +22,10 @@ export const DEFAULT_PAKE_OPTIONS: PakeCliOptions = {
};
// Just for cli development
export const DEFAULT_DEV_PAKE_OPTIONS: PakeCliOptions & {url: string} = {
export const DEFAULT_DEV_PAKE_OPTIONS: PakeCliOptions & { url: string } = {
...DEFAULT_PAKE_OPTIONS,
url: 'https://weread.qq.com',
name: 'WeRead',
safeDomain:['weread.qq.com'],
transparent: true,
}
safeDomain: ['weread.qq.com'],
hideTitleBar: true,
};

10
bin/helpers/merge.ts vendored
View File

@@ -12,9 +12,10 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon
width,
height,
fullscreen,
transparent,
hideTitleBar,
alwaysOnTop,
disabledWebShortcuts,
activationShortcut,
userAgent,
showSystemTray,
systemTrayIcon,
@@ -33,10 +34,11 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon
width,
height,
fullscreen,
transparent,
alwaysOnTop,
disabledWebShortcuts,
resizable,
hide_title_bar: hideTitleBar,
activation_shortcut: activationShortcut,
always_on_top: alwaysOnTop,
disabled_web_shortcuts: disabledWebShortcuts,
};
Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });

4
bin/types.ts vendored
View File

@@ -21,8 +21,8 @@ export interface PakeCliOptions {
// Whether the window can be fullscreen, default false
fullscreen: boolean;
// Enable immersive header, default false
transparent: boolean;
// Enable immersive header, default false.
hideTitleBar: boolean;
// Enable windows always on top, default false
alwaysOnTop: boolean;