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 469239 - Make GtkMenuItem's arrow size themeable
Make GtkMenuItem's arrow size themeable
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkMenu
2.11.x
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-08-22 13:16 UTC by Michael Natterer
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch implementing the above (2.41 KB, patch)
2007-08-22 13:17 UTC, Michael Natterer
none Details | Review
alternative version getting rid of useless thickness dependency (2.35 KB, patch)
2007-08-22 13:30 UTC, Michael Natterer
committed Details | Review
Animation illustrating the difference (31.57 KB, image/gif)
2007-08-22 14:59 UTC, Michael Natterer
  Details

Description Michael Natterer 2007-08-22 13:16:39 UTC
Attached patch adds an "arrow-scaling" style property to GtkMenuItem
which makes the arrow themeable relative to the menu item's
font size.

Works nicely and includes a micro cleanup to gtk_menu_item_expose().
Comment 1 Michael Natterer 2007-08-22 13:17:20 UTC
Created attachment 94113 [details] [review]
Patch implementing the above
Comment 2 Michael Natterer 2007-08-22 13:30:31 UTC
Created attachment 94117 [details] [review]
alternative version getting rid of useless thickness dependency

Besides, what's that "- 2 * widget->style->ythickness" good for? Why on
earth do we subtract thickness from something font-size based.

When removing that the arrows finally look like real arrows and not
any more like dirt or fly shit on the screen.
Comment 3 Michael Natterer 2007-08-22 14:59:33 UTC
Created attachment 94123 [details]
Animation illustrating the difference

It's not that apparent in the default theme but just use your fantasy
to imagine the fly shit drawn by themes which don't render filled
rectangles for arrows :-)
Comment 4 Matthias Clasen 2007-09-09 20:41:02 UTC
Looks ok to me; if we go with this, there are some other places where we render horizontal arrows that should probably depend on the font size in this way, e.g. GtkCalendar
Comment 5 Behdad Esfahbod 2007-11-21 09:24:23 UTC
2007-11-21  Behdad Esfahbod  <behdad@gnome.org>

        * gtk/gtkmenuitem.c (gtk_menu_item_class_init),
        (gtk_menu_item_paint): Make GtkMenuItem's arrow size themeable.
        (#469239, Michael Natterer)

Comment 6 Christian Persch 2007-11-28 14:52:46 UTC
This commit introduced a rogue g_printerr() that's spamming the console whenever a menu item is drawn:

gtk_menu_item_paint: scaling = 0,800000   size = 17   extent = 13
gtk_menu_item_paint: scaling = 0,800000   size = 17   extent = 13
gtk_menu_item_paint: scaling = 0,800000   size = 17   extent = 13
[etc.]