diff --git a/config/default.toml b/config/default.toml index 1d3fd90..4c47230 100644 --- a/config/default.toml +++ b/config/default.toml @@ -2,6 +2,7 @@ custom_css = "" width = 900 height = 400 +always_on_top = false [vars] font = '"SF mono", "Cascadia Code", "CascadiaCode Nerd Font", monaco, monospace' diff --git a/src/main.rs b/src/main.rs index 9bb8ee5..c362708 100644 --- a/src/main.rs +++ b/src/main.rs @@ -77,6 +77,7 @@ fn main() { }); let width = app_config.global.width; let height = app_config.global.height; + let always_on_top = app_config.global.always_on_top; GLOBAL_CONFIG.set(app_config).unwrap(); tauri::Builder::default() @@ -86,6 +87,9 @@ fn main() { window .set_size(tauri::Size::Physical(tauri::PhysicalSize { width, height })) .unwrap(); + window + .set_always_on_top(always_on_top) + .unwrap(); Ok(()) }) .manage(Scripts(Default::default())) diff --git a/src/settings.rs b/src/settings.rs index 55b01fe..f843d8c 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -13,6 +13,7 @@ pub struct Global { pub custom_css: String, pub width: u32, pub height: u32, + pub always_on_top: bool, } #[derive(Debug, Serialize, Deserialize)]