GNOME Bugzilla – Bug 96236
Draw menus better
Last modified: 2011-02-04 16:16:03 UTC
The patch I'll attach shortly does - use a black border around menus - increase spacing around separator menu items and center the separator line in its allocation - increase spacing around toggles and icons in menus - add a bit of vertical padding around menus - makes arrows a bit bigger Before and after shots at http://www.daimi.au.dk/~sandmann/pictures/nautilus-before.png http://www.daimi.au.dk/~sandmann/pictures/nautilus-after.png The black border and the bigger arrows look slightly weird with the bevels on selected menu items. With the flat menus from #80691, the black border makes it easier to see where one menu stops and another begins. The extra spacing works well with both the current and the suggested color scheme.
I should add that the patch creates four new style properties: - GtkMenu::vertical_padding - GtkMenuItem::horizontal_padding - GtkMenuItem::icon_spacing - GtkMenuItem::arrow_spacing
Created attachment 11686 [details] [review] The patch
I am putting this on the 2.2.0 milestone, because I think it should be looked at together with the color scheme thing (#80691). Ie., if this is 2.4, then the color scheme should also be 2.4.
Unmilestoning until I get a chance to update my bug lists.
Putting on 2.4 ... too much other stuff to deal with for 2.2. I'm not sure that the black line is consisistent with the rest of the style of the current default theme... also if we do go with a black line here, there are some other places in GTK+, like the GtkHandleBox tearoff window that would get one as well.
I think it looks significantly nicer with these changes. Cc'ing some artists.
I'd like to have a better look at this patch. Can you update it to apply cleanly to gtk+ 2.2.0? I just created a somewhat similar patch to GTK+, which centers SeparatorMenuItem, and adds a 1px border to all menuitems, so that there is some spacing between icons. Thanks.
I think this is an improvement, the current menus get too squeezed together especially with small fonts, so it looks better this way. I agree with the "could use this on other places as well" -thing.
Created attachment 13678 [details] [review] Patch to center GtkSeparatorMenuItems
I just attached a patch to center the Separator menuitems. Can we get at least this part in a 2.2.x release? It will make the themes look a LOT better than they do now. As for the black border... does it always exist, or is it disableable? It is a nice thing to have, but it will make engines that have totally flat menus look worse, I think, weird at least anyway. I'd really like to try the main patch on 2.2 and check it out for bugs or other weird issues if possible.
Rodney: the black borders are part of the default theme engine, so themes that use their own engine will not be affected. I am going to upload a new patch shortly. The new patch has as its main features that - it applies cleanly - it tweaks the vertical padding a bit (from 3 to 0) It does not actually deal with handleboxes, because - handleboxes do not request any space for borders, and making them do so would make it look weird when the child is a menu bar or another widget that draws its own frame - handleboxes are basically unused (applications always use BonoboDock). - handleboxes will be deprecated when a GtkDock arrives - it doesn't look terrible the way it is For these reasons I don't think it's worth dealing with handleboxes for this cosmetic issue.
That should be "from 3 to _1_"
Created attachment 17948 [details] [review] Updated patch
Created attachment 18036 [details] [review] New patch
New patch attached that fixes image items in RTL mode To give a better idea of how it looks, here is a new screenshot: http://www.daimi.au.dk/~sandmann/pictures/pretty-menus.png
Why don't you just go ahead and commit this stuff to HEAD - I'm never going to have the time (or, really, interest) to go through these changes line by line, pixel by pixel. Just a few general comments: * It would be nice to have an entry in widget-geometry.txt for any widget where you are adding style properties for padding values. * With the relatively heavy menu border, the overlap and offset of the submenus really looks odder than currently. Might be good to look at bug 96557. * Having "icon_spacing" in GtkMenuItem and having it affect the indicator is a bit odd. I'd go with "toggle_spacing", which while also weird, at least matches ::toggle_size_request(). * +#include "gtkhandlebox.h" is a leftover.
Sun Jul 6 17:21:23 2003 Soeren Sandmann <sandmann@daimi.au.dk> * docs/widget_geometry.txt: better drawing of GtkMenuItem * docs/widget_geometry.txt: add notes about GtkMenu * gtk/gtkstyle.c: remove leftover "#include "gtkhandlebox.h"" Sat Jul 5 10:34:00 2003 Soeren Sandmann <sandmann@daimi.au.dk> * gtk/gtkmenu.c: add vertical_padding style property. * gtk/gtkmenuitem.c: add style properties toggle_spacing, arrow_spacing and horizontal_padding. Also center separators and make them a bit taller. * gtk/*menuitem.c: use new style properties. * docs/widget_geometry.txt: Add note about GtkMenuItem * gtk/gtkstyle.c (gtk_default_draw_vline, gtk_default_draw_hline): fix +/-1 errors. (gtk_default_draw_shadow): draw a black border around menus. * gtk/gtkvseparator, gtk/gtkhseparator.c, gtk/gtkmenuitem.c: fix calls to gtk_paint_hline() and gtk_paint_vline() (they take x1, x2 and y1, y2 respectively, not x, width and y, height).