-
-
Notifications
You must be signed in to change notification settings - Fork 690
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
cocoa: add standard app menu items #1262
cocoa: add standard app menu items #1262
Conversation
Added "Hide <app>", "Hide Others" and "Show All" in a separate section immediately preceding "Quit". Also added Cmd+, as a shortcut for "Preferences" and sectioned it off. Closes beeware#1261. Signed-off-by: layday <[email protected]>
I don't know if this is the correct approach to using rubicon - happy to shift things around. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome - thanks for the patch!
I'll merge this as-is, as it's a significant improvement. However, if you're looking for a small place to tinker and tweak, I noticed that the "Show All" option is always active. On other apps, it's disabled unless there are hidden apps. I'm not sure what mechanism is driving that - I'm guessing it has something to do with NSWorkSpaceDidHideApplicationNotification - but it seems weird that every app would need to implement logic to determine if there are currently hidden apps.
I suspect that the automatic enabling and disabling is typically driven by the responder implementing In this case, the responder should be |
Thanks for merging. I tried hooking it up to |
Strange, I've just tried this out myself and it works both with Edit: I'm not sure if this actually calls |
That does work, I was doing it on the menu bar 🤦 When I tried it on the app delegate it was class AppDelegate(NSObject):
@objc_method
def validateMenuItem_(self, sender) -> bool:
cmd = self.interface._impl._menu_items[sender]
return cmd.enabled |
Yes, exactly.
I like that approach! |
Added "Hide ", "Hide Others" and "Show All" in a separate
section immediately preceding "Quit". Also added Cmd+, as
a shortcut for "Preferences" and sectioned it off.
Closes #1261.
Signed-off-by: layday [email protected]
PR Checklist: