From f906cc52cbaa00435a3fdfd7f23726a1d2320cb1 Mon Sep 17 00:00:00 2001 From: Stephan Lagerwaard Date: Wed, 2 Oct 2024 16:23:37 +0200 Subject: [PATCH] Append workspace related menu items to existing menu (#289) * Append workspace related menu items to existing menu * Try using native cut/copy/paste * Also add undo/redo/select_all --------- Co-authored-by: Benno van den Berg --- fpx-app/src/main.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/fpx-app/src/main.rs b/fpx-app/src/main.rs index 831c9acf5..016eb1345 100644 --- a/fpx-app/src/main.rs +++ b/fpx-app/src/main.rs @@ -39,12 +39,6 @@ fn main() { .ok_or("Store not found") .unwrap(); - let quit_app = MenuItemBuilder::new("Quit") - .id("quit_app") - .accelerator("CmdOrCtrl+Q") - .build(app) - .unwrap(); - let open_workspace = MenuItemBuilder::new("Open workspace") .id("open_workspace") .accelerator("CmdOrCtrl+O") @@ -61,7 +55,15 @@ fn main() { .item(&open_workspace) .item(&close_workspace) .separator() - .item(&quit_app) + .undo() + .redo() + .separator() + .cut() + .copy() + .paste() + .select_all() + .separator() + .close_window() .build() .unwrap(); @@ -82,9 +84,6 @@ fn main() { let MenuId(id) = event.id(); match id.as_str() { - "quit_app" => { - std::process::exit(0); - } "close_workspace" => { let app_state = window_.state::(); if app_state.get_workspace().is_some() {