After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 742181 - "show images in menus" causes weird padding outside GNOME
"show images in menus" causes weird padding outside GNOME
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Themes
3.15.x
Other Linux
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-01-01 14:41 UTC by Mantas Mikulėnas (grawity)
Modified: 2015-01-19 01:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot of eog under xfce4 (76.03 KB, image/png)
2015-01-01 14:41 UTC, Mantas Mikulėnas (grawity)
  Details
pygobject example (660 bytes, text/plain)
2015-01-01 20:32 UTC, Christoph Reiter (lazka)
  Details
gtkimagemenuitem: create widget for action icons lazily (4.90 KB, patch)
2015-01-12 08:11 UTC, Lars Karlitski
accepted-commit_now Details | Review

Description Mantas Mikulėnas (grawity) 2015-01-01 14:41:21 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
Comment 1 Christoph Reiter (lazka) 2015-01-01 20:32:41 UTC
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.
Comment 2 Lars Karlitski 2015-01-12 08:11:08 UTC
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.
Comment 3 Matthias Clasen 2015-01-18 21:31:49 UTC
Review of attachment 294325 [details] [review]:

Looks good to me