GNOME Bugzilla – Bug 332022
Themeable separators
Last modified: 2006-03-03 12:40:59 UTC
Maemo-gtk has a modification that uses gtk_paint_box() instead of gtk_paint[vh]line() to draw separators. I've taken that and extended it so separators are much more themeable. Attached patch adds 3 style properties to GtkWidget (bool variable-separators, int separator-width, int separator-height) and uses them in Gtk[HV]Separator, GtkMenuItem and GtkToolbar to optionally paint a configurable rectangle instead of a simple line. The patch uses GTK_SHADOW_ETCHED_OUT so the stuff is visible in the default theme, but that's pretty much arbitrary, since it's not really supposed to be used without a custom theme engine and/or theme.
Created attachment 59841 [details] [review] Patch against HEAD implementing the above
Hmm, no strong reaction here. Why can't the extra theming not be done in the draw_hline/draw_vline implementations of the theme ?
extra theming that is implemented in just draw_hline/draw_vline would be restricted to the xthicknes or ythicknes for the separators. changing separator sizes requires changing the size requisition which is what the patch does. also, draw_box has to be used to pass the extra available separator space on to the theme engine which couldn't be achieved with draw_hline/draw_vline because they implicitely always assume xthickness/ythickness.
That explains it. Should the style property be called wide-separators then, maybe ? If that is the main purpose of switching to draw_box... Anyway, I am curious where this is actually used in the 770. Can you point me to a wide separator ?
Created attachment 60477 [details] screenshot of standard maemo separator
Created attachment 60478 [details] thick separator mockups
matthias, do you mean s/variable-separators/wide-separators/ ? sounds reasonable to me. about pointing you to wide separators, maemo doesn't make extensive use of them, i.e. the separators aren't several tens of pixels width, still i've attached a screen shot that shows a 3 pixel wide separator, and also an image that shows wide separator mockups which can be implemented by themes once this patch is applied.
Thanks for the screenshot. Yes, I meant s/variable-separators/wide-separators/ I don't feel very strongly about it, though. Feel free to commit with or without that change. I think we need to start a "Whats new for theme authors" section in the NEWS, to make people aware of the new possibilities.
Comitted with s/variable-separators/wide-separators/. Also fixed off-by-one errors that were in the patch and always pass either "hseparator" or "vseparator" as detail to gtk_paint_box() since stuff like "toolbar" or "menuitem" is not very helpful when figuring the separator's orientation. 2006-03-03 Michael Natterer <mitch@imendio.com> Applied modified patch from maemo-gtk which makes separators more themeable. Fixes bug #332022. * gtk/gtkwidget.c: added style properties "wide-separators", "separator-width" and "separator-height". * gtk/gtkhseparator.c * gtk/gtkvseparator.c * gtk/gtkmenuitem.c * gtk/gtktoolbar.c: honor the new settings and paint separators using gtk_paint_box() if wide-separators is true.