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 332022 - Themeable separators
Themeable separators
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-02-21 11:53 UTC by Michael Natterer
Modified: 2006-03-03 12:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch against HEAD implementing the above (16.06 KB, patch)
2006-02-21 11:54 UTC, Michael Natterer
none Details | Review
screenshot of standard maemo separator (51.30 KB, image/png)
2006-03-02 11:47 UTC, Tim Janik
  Details
thick separator mockups (1.45 KB, image/png)
2006-03-02 11:48 UTC, Tim Janik
  Details

Description Michael Natterer 2006-02-21 11:53:28 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.
Comment 1 Michael Natterer 2006-02-21 11:54:22 UTC
Created attachment 59841 [details] [review]
Patch against HEAD implementing the above
Comment 2 Matthias Clasen 2006-02-22 20:23:40 UTC
Hmm, no strong reaction here. 
Why can't the extra theming not be done in the draw_hline/draw_vline
implementations of the theme ?
Comment 3 Tim Janik 2006-02-27 14:06:14 UTC
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.
Comment 4 Matthias Clasen 2006-02-27 17:04:09 UTC
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 ?
Comment 5 Tim Janik 2006-03-02 11:47:47 UTC
Created attachment 60477 [details]
screenshot of standard maemo separator
Comment 6 Tim Janik 2006-03-02 11:48:21 UTC
Created attachment 60478 [details]
thick separator mockups
Comment 7 Tim Janik 2006-03-02 11:51:09 UTC
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.
Comment 8 Matthias Clasen 2006-03-02 13:33:36 UTC
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.
Comment 9 Michael Natterer 2006-03-03 12:40:59 UTC
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.