Correct built-in open and save menu items.#930
Correct built-in open and save menu items.#930luleyleo merged 3 commits intolinebender:masterfrom luleyleo:fix-open-and-save-menus
Conversation
druid/src/menu.rs
Outdated
| @@ -566,8 +566,8 @@ pub mod sys { | |||
| /// The 'Save' menu item. | |||
There was a problem hiding this comment.
Update the comment here for Windows. Just take the macOS comment I think.
There was a problem hiding this comment.
Thanks! I knew I would forget something when splitting things up 😅
|
Just for the historical record: a lot of this menu stuff is specifically motivated by my wanting, on the mac, to mimic the look and behaviour of Cocoa apps. In particular this means that if you are an app that manages documents, and you have a new unsaved document, the "save" menu item is titled "Save..." and will bring up the save panel; that is it behaves like "save as". If you've already saved the document, it is titled "Save", does not bring up the dialog, and just saves it at its existing location. In Cocoa menus, any menu item that will ask for additional options has a trailing ellipsis; menu items that work without further input do not. So I'm not totally sure if this makes sense on windows or elsewhere, or not? |
|
@cmyr We had a rather long Zulip discussion (linked in the PR comment) where we discovered that basically all platforms recommend doing this, it's just that they do not adhere to their own guidelines. |
|
The Windows and Gnome/KDE docs recommend that exact same approach. In practice nobody follows it. That said, I think it's fine (and simplifies things) if we just recommend the "Save..." -> "Save" situation (like it works on macOS) on all platforms. |
|
One thing I'd like to do in the future is to rework menus to work more like widgets; that is they can be computed based on the data, and updated automatically. In this world if we can just have some way to check that a document has a path, we can do this automatically. |
Second part of #908 .
Based on the Zulip discussion here.
On Windows / Linux:
save_ellipsisnow actually displays an ellipsis.On mac:
open_fileshows the dialog instead of submitting an invalidOPEN_FILEcommand.All:
save_ellipsisshows the dialog and thus behaves likesave_asinstead ofsave.