Skip to content

Commit

Permalink
Append workspace related menu items to existing menu (#289)
Browse files Browse the repository at this point in the history
* 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 <bennovandenberg@gmail.com>
  • Loading branch information
stephlow and hatchan authored Oct 2, 2024
1 parent e93ed08 commit f906cc5
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions fpx-app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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();

Expand All @@ -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::<AppState>();
if app_state.get_workspace().is_some() {
Expand Down

0 comments on commit f906cc5

Please sign in to comment.