Skip to content

Commit

Permalink
also toggle window decorations
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoBSalgueiro committed Dec 10, 2023
1 parent 4c2bbb2 commit dffbc9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,18 +246,20 @@ fn is_bmi2_compatible() -> bool {

#[tauri::command]
#[specta::specta]
fn is_menu_visisble(window: tauri::Window) -> bool {
async fn is_menu_visisble(window: tauri::Window) -> bool {
window.menu_handle().is_visible().unwrap()
}

#[tauri::command]
#[specta::specta]
fn set_menu_visisble(state: bool, window: tauri::Window) {
async fn set_menu_visisble(state: bool, window: tauri::Window) {
let menu = window.menu_handle();
if state {
menu.show().unwrap();
window.set_decorations(true).unwrap();
} else {
menu.hide().unwrap();
window.set_decorations(false).unwrap();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/atoms/atoms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const primaryColorAtom = atomWithStorage<MantineColor>(
export const sessionsAtom = atomWithStorage<Session[]>("sessions", []);
export const nativeBarAtom = atomWithStorage<boolean>(
"native-bar",
true
false
);

// Database
Expand Down

0 comments on commit dffbc9f

Please sign in to comment.