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 163887 - Menu items don't have equal *minimum* height
Menu items don't have equal *minimum* height
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkMenu
2.12.x
Other Linux
: Normal normal
: Small fix
Assigned To: gtk-bugs
gtk-bugs
: 465959 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-01-13 02:57 UTC by Jorn Baayen
Modified: 2018-02-10 03:38 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Screenshot (26.46 KB, image/png)
2005-01-13 17:31 UTC, Jorn Baayen
  Details
suggested patch to gtkmenuitem.c (886 bytes, patch)
2006-03-30 08:44 UTC, ahunter
none Details | Review
revised patch (1.17 KB, patch)
2006-04-18 06:13 UTC, ahunter
reviewed Details | Review
Gtk 2.12.9-3 from Debian (36.68 KB, image/png)
2008-04-16 07:04 UTC, Josef Kufner
  Details

Description Jorn Baayen 2005-01-13 02:57:40 UTC
A menu item with a stock icon will usually be a few pixels higher than a menu
item without. This looks ugly. (This is using the action stuff)
Comment 1 Matthias Clasen 2005-01-13 14:58:08 UTC
Do you have a screenshot ?
Comment 2 Jorn Baayen 2005-01-13 17:31:58 UTC
Created attachment 35961 [details]
Screenshot
Comment 3 Matthias Clasen 2005-01-20 03:08:55 UTC
As a workaround, you could use a fully transparent image of the right height
for the image-less menu items.
Comment 4 Jorn Baayen 2005-01-20 10:33:55 UTC
This won't work for check and radio menu items though.
Comment 5 ahunter 2006-03-30 08:44:38 UTC
Created attachment 62364 [details] [review]
suggested patch to gtkmenuitem.c

This suggested patch forces minimum menu item height based on GTK_ICON_SIZE_MENU.

Menu bars are excluded from being affected.
Comment 6 Matthias Clasen 2006-03-31 15:51:13 UTC
You need to use gtk_icon_size_lookup_for_settings() to be multihead-safe
Comment 7 ahunter 2006-04-18 06:13:45 UTC
Created attachment 63771 [details] [review]
revised patch

From the Zaphod Beeblebrox department - multihead-safe patch
Comment 8 Philip Withnall 2007-05-26 16:49:19 UTC
Patch 63771 applies cleanly. Reviewing it would take little time.

(Working on http://mail.gnome.org/archives/gtk-devel-list/2007-March/msg00148.html)
Comment 9 Emmanuele Bassi (:ebassi) 2007-06-12 10:39:41 UTC
instead of keep asking the theme for the size, the GtkMenuItem should just ask it on GtkWidget::style-set and GtkWidget::screen-changed and cache the value.

I'll work on a patch doing this.
Comment 10 Emmanuele Bassi (:ebassi) 2007-06-12 10:49:33 UTC
mmh, just realised that MenuItem doesn't have any private data to use for the cache, and adding a private structure for an integer is a waste of space. so, I guess the patch will have to do.
Comment 11 Xan Lopez 2007-08-20 17:55:30 UTC
*** Bug 465959 has been marked as a duplicate of this bug. ***
Comment 12 Diego Escalante Urrelo (not reading bugmail) 2008-03-15 20:35:09 UTC
PING!
Comment 13 Benjamin Berg 2008-03-16 14:17:54 UTC
Bug 485754 which I opened some time ago is about the same issue.
Comment 14 Diego Escalante Urrelo (not reading bugmail) 2008-04-16 05:11:51 UTC
I can't reproduce with 2.12. Closing obsolete. Reopen if you have an updated screenshot.
Comment 15 Josef Kufner 2008-04-16 07:04:59 UTC
Created attachment 109356 [details]
Gtk 2.12.9-3 from Debian

Screenshot of gimp and evolution.
Comment 16 Diego Escalante Urrelo (not reading bugmail) 2008-04-16 07:21:23 UTC
Weird...

I can't reproduce, updating version from your comment.

Maybe it's your font? I'm using Droid Sans as font, you seem to be using something simpler (nimbus?).
Comment 17 Josef Kufner 2008-04-16 07:55:32 UTC
It is simple. My font is smaller than icon. And menu item height is set by the tallest thing in this menu item.

Your tallest thing is text and the text has allways same height. My tallest thing is icon, or text if there is no icon. But heights of text and icon aren't same...

And I'm using very old font called Helvetica.
Comment 18 Diego Escalante Urrelo (not reading bugmail) 2008-04-16 08:27:44 UTC
Aha!. Thanks for the clarification. Then it means that the patch is useful :). I'll update the wiki. I added the *minimum* word to the summary.
Comment 19 Josef Kufner 2008-04-16 11:58:15 UTC
But when menu item has minimum larger than minimal, it is not minimum any more :)
Comment 20 Matthias Clasen 2018-02-10 03:38:05 UTC
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and
still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue
for it.