GNOME Bugzilla – Bug 741610
Finish up support for macos menubar
Last modified: 2014-12-23 13:03:08 UTC
This is the "0.1" part of the promised future where each app would only need 2.1 menus. This adds support for hiding a few select items on Mac OS in order to avoid having to create a completely separate menu structure there.
Created attachment 292852 [details] [review] GtkMenuTracker: add missing documentation fragment
Created attachment 292853 [details] [review] GtkMenuTracker: add hidden-when='macos-menubar' Provide a mechanism for hiding the "Quit", "About" and "Preferences" menu items from the normal places in a traditional menubar layout (in the File and Edit menus) when the menu is being rendered in the Mac OS menubar. These items can already be found in the application menu. With this feature, applications can now define a single menu to use in all 'traditional' scenarios. Use this new attribute in Bloatpad.
Created attachment 292855 [details] [review] Use the OSX menubar layout for XFCE, Unity, etc. Experimental patch to show what hidden-when='macos-menubar' means for gedit.
Review of attachment 292852 [details] [review]: Sure
Review of attachment 292853 [details] [review]: gboolean mac_os_mode is not the most inspired api choice. But as long as it's just internal, maybe good enough
Review of attachment 292855 [details] [review]: Here it goes from uninspired to actively misleading. if you want this used 'everywhere not gnome', it should not be called macos
Review of attachment 292855 [details] [review]: This was just a quick hack to give the gedit developers an idea of the direction to go in. It's not complete. Perhaps the commit message could use a bit of clarification. The intention is that you add "hidden-when=macos" to your traditional menubar file which gets used everywhere there is no app menu. This field means absolutely nothing unless mac_os_mode is TRUE, and that's only ever TRUE on macos. Even on macos, it's only true while populating the top menubar, so it wouldn't even apply to popovers rendered on macos, for example.
Review of attachment 292853 [details] [review]: I considered folding the (now) 3 booleans into a flags field but I didn't bother with that precisely because this is only internal API. I also considered just using an #ifdef on Mac OS but I don't want to apply this in cases where we are: a) using the X11 backend and rendering a normal menubar inside of an X window b) popovers and so on So basically this field is the "are we rendering the macos menubar" field (as explained in the docs " @mac_os_mode: if this is on behalf of the Mac OS menubar ").
Comment on attachment 292853 [details] [review] GtkMenuTracker: add hidden-when='macos-menubar' ok then
Comment on attachment 292852 [details] [review] GtkMenuTracker: add missing documentation fragment Attachment 292852 [details] pushed as ef2c684 - GtkMenuTracker: add missing documentation fragment
Attachment 292853 [details] pushed as 6b26664 - GtkMenuTracker: add hidden-when='macos-menubar'