Skip to content

Commit

Permalink
Now, the window will always remain on top (this can be tweaked though…
Browse files Browse the repository at this point in the history
… in app_config.json)
  • Loading branch information
CaspianA1 committed Feb 3, 2025
1 parent b4ab832 commit 3571359
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
11 changes: 6 additions & 5 deletions assets/app_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"title": "WBOR Studio Dashboard",
"theme_name": "barebones",
"icon_path": "assets/plane.bmp",
"maybe_pause_subduration_ms_when_window_unfocused": 250,

"hide_cursor": true,
"use_linear_filtering": true,
"window_always_on_top": true,
"maybe_pause_subduration_ms_when_window_unfocused": null,

"o1": {"Windowed": [1024, 768, false, null]},
"o2": "FullscreenDesktop",
"screen_option": "Fullscreen",

"hide_cursor": true,
"use_linear_filtering": true
"screen_option": "Fullscreen"
}
8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ struct AppConfig {
title: String,
theme_name: String,
icon_path: String,

hide_cursor: bool,
use_linear_filtering: bool,
window_always_on_top: bool,
maybe_pause_subduration_ms_when_window_unfocused: Option<u32>,

screen_option: ScreenOption,
hide_cursor: bool,
use_linear_filtering: bool
}

//////////
Expand Down Expand Up @@ -161,6 +163,8 @@ async fn main() -> MaybeError {
}
}

sdl_window.set_always_on_top(app_config.window_always_on_top);

sdl_window.set_icon(Surface::from_file(app_config.icon_path).to_generic()?);

////////// Making a SDL canvas
Expand Down

0 comments on commit 3571359

Please sign in to comment.