Skip to content

Commit

Permalink
feat(tauri): full screen mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sekwah41 committed Nov 12, 2023
1 parent 702f419 commit d59ca69
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions app/tauri/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,28 @@ fn set_show<R: Runtime>(_window: tauri::Window<R>) {
#[tauri::command]
fn set_always_on_top<R: Runtime>(always_on_top: bool, window: tauri::Window<R>) {
println!("set_always_on_top! {}", always_on_top);
match window.set_always_on_top(always_on_top) {
Ok(_) => (),
Err(e) => println!("There was a problem altering always on top: {}", e),
}
try_set_always_on_top(always_on_top, &window);
}

#[tauri::command]
fn set_fullscreen_break<R: Runtime>(should_fullscreen: bool, always_on_top: bool, _window: tauri::Window<R>) {
fn set_fullscreen_break<R: Runtime>(should_fullscreen: bool, always_on_top: bool, window: tauri::Window<R>) {
println!("set_fullscreen_break! {} {}", should_fullscreen, always_on_top);
try_set_always_on_top(always_on_top, &window);
try_set_fullscreen(should_fullscreen, &window);
}

fn try_set_fullscreen<R: Runtime>(fullscreen: bool, window: &tauri::Window<R>) {
match window.set_fullscreen(fullscreen) {
Ok(_) => (),
Err(e) => println!("There was a problem setting fullscreen: {}", e),
}
}

fn try_set_always_on_top<R: Runtime>(always_on_top: bool, window: &tauri::Window<R>) {
match window.set_always_on_top(always_on_top) {
Ok(_) => (),
Err(e) => println!("There was a problem altering always on top: {}", e),
}
}

fn try_set_min_size<R: Runtime>(size: Option<PhysicalSize<u32>>, window: &tauri::Window<R>) {
Expand Down

0 comments on commit d59ca69

Please sign in to comment.