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 585421 - All menu items have space for icons
All menu items have space for icons
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkMenu
2.16.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 322934
Blocks:
 
 
Reported: 2009-06-11 08:41 UTC by Yeti
Modified: 2009-11-27 20:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (16.83 KB, image/png)
2009-06-11 08:44 UTC, Yeti
  Details
patch (1.04 KB, patch)
2009-06-16 08:29 UTC, Yeti
none Details | Review
screenshot (10.23 KB, image/png)
2009-06-21 18:00 UTC, Yeti
  Details

Description Yeti 2009-06-11 08:41:26 UTC
All menu items in all menus have reserved space for icons.  This produces various ugly effects in menus where this is not desired (see the attachment for an example).

This is a regression in Gtk+ 2.16.  In 2.14, things just worked: menus with icons/radios/checks have the space for them, other menus did not.
Comment 1 Yeti 2009-06-11 08:44:44 UTC
Created attachment 136322 [details]
screenshot

Don't mind the black stripe, that's some screenshotting artefact.

Compared to previous Gtk+ versions, there is also some weird wasted space on the right side of the menu, though that's something one could perhaps live on.
Comment 2 Yeti 2009-06-16 08:29:16 UTC
Created attachment 136699 [details] [review]
patch

Patch that removes the misfeature, reverting behaviour to 2.14.
Comment 3 Yeti 2009-06-21 18:00:29 UTC
Created attachment 137130 [details]
screenshot

The original screenshot is rather tame.  Normal menus look just weird in 2.16, but multicolumn menus of small items became really ugly and rather unusable, as demonstrated by this screenshot.
Comment 4 Yeti 2009-06-21 18:20:38 UTC
I was finally able to find bug 322934 that introduced this misfeature (git is queer, I wonder how to get the list of commits to a single file from it -- a trivial operation with svn).  Reopening that...
Comment 5 Matthias Clasen 2009-06-22 13:58:40 UTC
I've now excluded comboboxes and tabular menus from the toggle size enforcing.
Comment 6 Yeti 2009-06-22 14:30:20 UTC
So, how do I make a single-column menu tabular?

The first posted example still looks bad.  Its menu entries will never have any icons as they already have images so they do not need the space.  These images cannot be GtkImageMenuItem icons because such icons are forced to take the same space vertically as horizontally (since Gtk+ 2.4) which would look extremely ugly.

Two examples where the new behaviour is unwanted have been found.  Are you sure that no third one exists?  Or that it cannot exists outside Gtk+ core?  Please permit applications to disable the wasted space.

I cannot fork GtkMenu since it is too hardwired in other places in Gtk+ and there are too many internal calls involved for an outside implementation to be a first-class citizen.
Comment 7 Matthias Clasen 2009-06-22 14:46:31 UTC
I'm still considering making no-toggle-space a regular menu property.
Comment 8 Matthias Clasen 2009-06-22 16:09:54 UTC
But that will be a 2.18 only api addition. For 2.16, what you can do as a workaround is to connect to toggle-size-request on the menuitems, and set the value to 1. That will have almost the same effect. Nobody will notice the 1 extra pixel...
Comment 9 Yeti 2009-06-23 11:29:16 UTC
(In reply to comment #7)
> I'm still considering making no-toggle-space a regular menu property.

I can write the patch if it helps.  Although implementation is the easy part here, this is primarily a matter of policy.

Thanks for the workaround hint.
Comment 10 Yeti 2009-06-24 09:23:04 UTC
(In reply to comment #9)
> I can write the patch if it helps.

Seems you were faster.
Comment 11 Matthias Clasen 2009-11-27 20:53:59 UTC
Seems we forgot to close this...