Skip to content

Commit

Permalink
add always on top config
Browse files Browse the repository at this point in the history
  • Loading branch information
Blakeinstein committed Aug 7, 2021
1 parent 5d4dcb3 commit 013b346
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()))
Expand Down
1 change: 1 addition & 0 deletions src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 013b346

Please sign in to comment.