-
-
Notifications
You must be signed in to change notification settings - Fork 674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per-window commands #2210
Comments
Generally agreed. The biggest issue/risk I see is around instance identity, and the coalescing process of window commands. If I have 2 windows, both of which have a "foobar" command, is that 2 instances of Command, or the same command added to 2 different windows? I'm also uncertain about one detail on Cocoa's coalescing of menus: would menu items for window A would be visible when Window B has focus (and if they are visible, are they enabled)? Discoverability would suggest they should be visible but disabled; but that could easily lead to overwhelming menus if A and B have disparate sets of commands. I guess we could add a property to Group that flags the group as being "window specific"... FWIW - I've been tinkering with #1870 and #97 in my spare time, and I've got a similar need there - it turns out to be easiest to flag a group as being a "system tray" group, which takes the group out of the normal menubar flow. There might be an analog here with Window-specific groups; although it might require registering groups with the window in addition to commands. |
Just saving this suggestion from #2244 (comment):
|
I think hiding them is the only reasonable solution:
|
What is the problem or limitation you are having?
If you want different menus for different windows, you currently need to detect when the active window changes and alter
App.commands
manually. This most obviously affects DocumentApp, where you might want to enable or disable commands depending on what the user has selected.But it may also affect other multi-window apps which don't involve "documents" per se. For example:
Describe the solution you'd like
Add a
Window.commands
property, which would work as follows:Since each window has its own toolbar, this implies that toolbar commands should be automatically added to
Window.commands
, rather thanApp.commands
at present.The text was updated successfully, but these errors were encountered: