✨ Add alwaysOnTop feature
This commit is contained in:
7
bin/README.md
vendored
7
bin/README.md
vendored
@@ -121,6 +121,13 @@ Enable or disable immersive header. Default is `false`. Use the following comman
|
||||
--transparent
|
||||
```
|
||||
|
||||
#### [always-on-top]
|
||||
Enable the always-on-top feature. Default is `false`.
|
||||
|
||||
```shell
|
||||
--always-on-top
|
||||
```
|
||||
|
||||
#### [fullscreen]
|
||||
|
||||
Determine whether the application launches in full screen. Default is `false`. Use the following command to enable full screen.
|
||||
|
||||
10
bin/README_CN.md
vendored
10
bin/README_CN.md
vendored
@@ -122,6 +122,16 @@ pake [url] [options]
|
||||
--transparent
|
||||
```
|
||||
|
||||
#### [always-on-top]
|
||||
设置是否窗口一直在最顶层,默认为 `false`。
|
||||
|
||||
```shell
|
||||
--always-on-top
|
||||
```
|
||||
|
||||
|
||||
```shell
|
||||
|
||||
#### [fullscreen]
|
||||
|
||||
设置应用程序是否在启动时自动全屏,默认为 `false`。使用以下命令可以设置应用程序启动时自动全屏。
|
||||
|
||||
1
bin/defaults.ts
vendored
1
bin/defaults.ts
vendored
@@ -7,6 +7,7 @@ export const DEFAULT_PAKE_OPTIONS: PakeCliOptions = {
|
||||
fullscreen: false,
|
||||
resizable: true,
|
||||
transparent: false,
|
||||
alwaysOnTop: false,
|
||||
userAgent: '',
|
||||
showSystemTray: false,
|
||||
multiArch: false,
|
||||
|
||||
2
bin/helpers/merge.ts
vendored
2
bin/helpers/merge.ts
vendored
@@ -13,6 +13,7 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon
|
||||
height,
|
||||
fullscreen,
|
||||
transparent,
|
||||
alwaysOnTop,
|
||||
userAgent,
|
||||
showSystemTray,
|
||||
systemTrayIcon,
|
||||
@@ -32,6 +33,7 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon
|
||||
height,
|
||||
fullscreen,
|
||||
transparent,
|
||||
alwaysOnTop,
|
||||
resizable,
|
||||
};
|
||||
Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });
|
||||
|
||||
3
bin/types.ts
vendored
3
bin/types.ts
vendored
@@ -24,6 +24,9 @@ export interface PakeCliOptions {
|
||||
// Enable immersive header, default false
|
||||
transparent: boolean;
|
||||
|
||||
// Enable windows always on top, default false
|
||||
alwaysOnTop: boolean;
|
||||
|
||||
// Custom User-Agent, default off
|
||||
userAgent: string;
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
"width": 1200,
|
||||
"height": 780,
|
||||
"resizable": true,
|
||||
"url_type": "web"
|
||||
"url_type": "web",
|
||||
"always_on_top": false
|
||||
}
|
||||
],
|
||||
"user_agent": {
|
||||
|
||||
@@ -9,6 +9,7 @@ pub struct WindowConfig {
|
||||
pub height: f64,
|
||||
pub resizable: bool,
|
||||
pub url_type: String,
|
||||
pub always_on_top: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
|
||||
@@ -27,6 +27,7 @@ pub fn get_window(app: &mut App, config: PakeConfig, _data_dir: PathBuf) -> Wind
|
||||
.fullscreen(window_config.fullscreen)
|
||||
.inner_size(window_config.width, window_config.height)
|
||||
.disable_file_drop_handler()
|
||||
.always_on_top(window_config.always_on_top)
|
||||
.initialization_script(include_str!("../inject/component.js"))
|
||||
.initialization_script(include_str!("../inject/event.js"))
|
||||
.initialization_script(include_str!("../inject/style.js"))
|
||||
|
||||
Reference in New Issue
Block a user