GNOME Bugzilla – Bug 469239
Make GtkMenuItem's arrow size themeable
Last modified: 2011-02-04 16:11:08 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().
Created attachment 94113 [details] [review] Patch implementing the above
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.
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 :-)
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
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)
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.]