From 2bcfbbed6b172e79de3612b9da539dcc8855cec9 Mon Sep 17 00:00:00 2001 From: Leopold Luley Date: Fri, 15 May 2020 07:45:50 +0200 Subject: [PATCH 1/2] Correct built-in open and save menu items. --- CHANGELOG.md | 2 ++ druid/src/menu.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b1d7bce8b..f467f82e41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,6 +82,7 @@ While some features like the clipboard, menus or file dialogs are not yet availa - GTK: Support file filters in open/save dialogs. ([#903] by [@jneem]) - X11: Support key and mouse button state. ([#920] by [@jneem]) - Routing `LifeCycle::FocusChanged` to descendant widgets. ([#925] by [@yrns]) +- Built-in open and save menu items now show the correct label and submit the right commands. ([#930] by [@finnerale]) ### Visual @@ -171,6 +172,7 @@ While some features like the clipboard, menus or file dialogs are not yet availa [#924]: https://github.com/xi-editor/druid/pull/924 [#925]: https://github.com/xi-editor/druid/pull/925 [#928]: https://github.com/xi-editor/druid/pull/928 +[#930]: https://github.com/xi-editor/druid/pull/930 ## [0.5.0] - 2020-04-01 diff --git a/druid/src/menu.rs b/druid/src/menu.rs index a66922330f..ba0ff91820 100644 --- a/druid/src/menu.rs +++ b/druid/src/menu.rs @@ -519,8 +519,8 @@ pub mod sys { .append(new()) .append(open()) .append(close()) - .append(save().disabled()) - .append(save_as().disabled()) + .append(save_ellipsis()) + .append(save_as()) // revert to saved? .append(print().disabled()) .append(page_setup().disabled()) @@ -566,8 +566,8 @@ pub mod sys { /// The 'Save' menu item. pub fn save_ellipsis() -> MenuItem { MenuItem::new( - LocalizedString::new("common-menu-file-save"), - commands::SAVE_FILE, + LocalizedString::new("common-menu-file-save-ellipsis"), + commands::SHOW_SAVE_PANEL, ) .hotkey(RawMods::Ctrl, "s") } @@ -742,7 +742,7 @@ pub mod sys { pub fn open_file() -> MenuItem { MenuItem::new( LocalizedString::new("common-menu-file-open"), - commands::OPEN_FILE, + commands::SHOW_OPEN_PANEL, ) .hotkey(RawMods::Meta, "o") } @@ -771,7 +771,7 @@ pub mod sys { pub fn save_ellipsis() -> MenuItem { MenuItem::new( LocalizedString::new("common-menu-file-save-ellipsis"), - commands::SAVE_FILE, + commands::SHOW_SAVE_PANEL, ) .hotkey(RawMods::Meta, "s") } From 88fd060eb0987f2cdbb2785118488917a4039368 Mon Sep 17 00:00:00 2001 From: Leopold Luley Date: Fri, 15 May 2020 16:58:48 +0200 Subject: [PATCH 2/2] Update save_ellipsis docs. --- druid/src/menu.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/druid/src/menu.rs b/druid/src/menu.rs index ba0ff91820..31cac785d1 100644 --- a/druid/src/menu.rs +++ b/druid/src/menu.rs @@ -563,7 +563,9 @@ pub mod sys { .hotkey(RawMods::Ctrl, "s") } - /// The 'Save' menu item. + /// The 'Save...' menu item. + /// + /// This is used if we need to show a dialog to select save location. pub fn save_ellipsis() -> MenuItem { MenuItem::new( LocalizedString::new("common-menu-file-save-ellipsis"),