Skip to content

Commit

Permalink
feat: add keybinds for menu actions (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
caoimhebyrne authored Oct 29, 2023
1 parent 9013db7 commit 7457b47
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ fn build_menu() -> Menu {
let application_menu = Submenu::new(
"typstudio",
Menu::new()
.add_native_item(MenuItem::About(String::from("typstudio"), AboutMetadata::new()))
.add_native_item(MenuItem::About(
String::from("typstudio"),
AboutMetadata::new(),
))
.add_native_item(MenuItem::Separator)
.add_native_item(MenuItem::Hide)
.add_native_item(MenuItem::HideOthers)
Expand All @@ -59,21 +62,22 @@ fn build_menu() -> Menu {
);

let mut file_menu = Menu::new()
.add_item(CustomMenuItem::new("file_open_project", "Open Project"))
.add_item(
CustomMenuItem::new("file_open_project", "Open Project").accelerator("CmdOrCtrl+O"),
)
.add_submenu(Submenu::new(
"Export",
Menu::new().add_item(CustomMenuItem::new("file_export_pdf", "Export PDF")),
Menu::new().add_item(
CustomMenuItem::new("file_export_pdf", "Export PDF").accelerator("CmdOrCtrl+E"),
),
));

#[cfg(not(target_os = "macos"))]
{
file_menu = file_menu.add_native_item(MenuItem::Quit);
}

let file_submenu = Submenu::new(
"File",
file_menu,
);
let file_submenu = Submenu::new("File", file_menu);
let edit_submenu = Submenu::new("Edit", Menu::new());
let view_submenu = Submenu::new(
"View",
Expand Down

0 comments on commit 7457b47

Please sign in to comment.