GNOME Bugzilla – Bug 742181
"show images in menus" causes weird padding outside GNOME
Last modified: 2015-01-19 01:06:14 UTC
Created attachment 293561 [details] screenshot of eog under xfce4 1) Start Xfce4. 2) Under Appearance, enable the "Show images in menus" option. 3) Start a gtk3 program with a menu bar (eog, gthumb). 4) Notice how the top-level menu items have an unnecessarily wide left margin (even though they should never, ever have icons). That is, instead of |File|Edit|View| you get |····File|····Edit|····View| gtk 3.15.3-87-g5a41f63
Created attachment 293574 [details] pygobject example Same problem here with GtkUIManager which creates GtkImageMenuItems with an empty GtkImage for the toplevel items. Commit causing this: https://git.gnome.org/browse/gtk+/commit/?id=b44df22895c79 Workaround is to remove the emtpy images for toplevel items using "gtk_image_menu_item_set_image (NULL);" See attached file for a minimal Python example.
Created attachment 294325 [details] [review] gtkimagemenuitem: create widget for action icons lazily GtkImageMenuItem always packs a GtkImage when it is synced with a related action. This is unnecessary when the action doesn't have an icon set and results in excess padding when a GtkImageMenuItem is put in a menu bar (GtkUIManager does this). Fix this by not creating the GtkImage for icon-less actions.
Review of attachment 294325 [details] [review]: Looks good to me