Skip to content

Commit

Permalink
Hopefully fix the menus
Browse files Browse the repository at this point in the history
  • Loading branch information
Marekkon5 committed Nov 21, 2023
1 parent 580f1b8 commit be6805c
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions crates/onetagger/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,32 @@ pub fn start_webview() -> Result<(), Error> {
{
use muda::{Menu, Submenu, PredefinedMenuItem};
let menu = Menu::new();
let submenu = Submenu::new("&Edit", true);
submenu.append(&PredefinedMenuItem::copy(None)).ok();
submenu.append(&PredefinedMenuItem::paste(None)).ok();
submenu.append(&PredefinedMenuItem::cut(None)).ok();
submenu.append(&PredefinedMenuItem::select_all(None)).ok();
submenu.append(&PredefinedMenuItem::undo(None)).ok();
submenu.append(&PredefinedMenuItem::redo(None)).ok();
submenu.append(&PredefinedMenuItem::quit(None)).ok();
menu.append(&submenu).ok();

let app_submenu = Submenu::new("App", true);
menu.append(&app_submenu).ok();

app_submenu.append_items(&[
&PredefinedMenuItem::about(None, None),
&PredefinedMenuItem::separator(),
&PredefinedMenuItem::hide(None),
&PredefinedMenuItem::hide_others(None),
&PredefinedMenuItem::show_all(None),
&PredefinedMenuItem::separator(),
&PredefinedMenuItem::quit(None),
]).ok();

let edit_submenu = Submenu::new("&Edit", true);
edit_submenu.append_items(&[
&PredefinedMenuItem::undo(None),
&PredefinedMenuItem::redo(None),
&PredefinedMenuItem::separator(),
&PredefinedMenuItem::cut(None),
&PredefinedMenuItem::copy(None),
&PredefinedMenuItem::paste(None),
&PredefinedMenuItem::select_all(None),
]).ok();

menu.append(&edit_submenu).ok();
menu.init_for_nsapp();
}

Expand Down

0 comments on commit be6805c

Please sign in to comment.