Skip to content

Commit

Permalink
refactor: adjust menu of windows
Browse files Browse the repository at this point in the history
  • Loading branch information
vicanso committed Dec 9, 2023
1 parent 990ac44 commit d4b2390
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@ fn main() {
// tracing::subscriber::set_global_default(subscriber).expect("setting default subscriber failed");

let context = tauri::generate_context!();
let menu = if cfg!(windows) {
tauri::Menu::new()
} else {
tauri::Menu::os_default(&context.package_info().name)
};

tauri::Builder::default()
.setup(|app| {
let dir = app.path_resolver().app_data_dir().unwrap();
util::set_app_dir(dir.to_str().unwrap().to_string());
Ok(())
})
.menu(tauri::Menu::os_default(&context.package_info().name))
.menu(menu)
.invoke_handler(tauri::generate_handler![
commands::close_splashscreen,
commands::init_tables,
Expand Down

0 comments on commit d4b2390

Please sign in to comment.