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 342249 - Allow to draw upper and lower sides of GtkRange's trough differently
Allow to draw upper and lower sides of GtkRange's trough differently
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.9.x
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 342257
Blocks:
 
 
Reported: 2006-05-18 13:17 UTC by Michael Natterer
Modified: 2006-06-09 13:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch implementing the above (4.92 KB, patch)
2006-05-18 13:18 UTC, Michael Natterer
none Details | Review

Description Michael Natterer 2006-05-18 13:17:26 UTC
Attached patch from maemo-gtk adds a boolean "trough-side-details"
property to GtkRange which splits the drawing of the trough in two
parts: one gets "trough-lower" passed as detail, the other
"trough-upper".
Comment 1 Michael Natterer 2006-05-18 13:18:24 UTC
Created attachment 65766 [details] [review]
Patch implementing the above
Comment 2 Tim Janik 2006-05-18 14:06:18 UTC
the patch looks good to me, but i suspect it's untested, right?
we should probably add a test program to gtk that installs a theming engine and can be used to check theming specific details that way.
Comment 3 Michael Natterer 2006-05-18 14:12:53 UTC
No it is tested, at least I tested that it gets the coordinates calculated
right in all cases, and i visually tested it by drawing the two parts
in different colors, instead of with different detail.
Comment 4 Tim Janik 2006-05-22 09:39:33 UTC
as it looks, this patch is being integrated into bug 342339.
Comment 5 Michael Natterer 2006-05-23 12:10:58 UTC
Attached combined patch to bug #342339 and obsoleted this
one because it makes no sense to patch the same few lines
of code over and over again.
Comment 6 Michael Natterer 2006-06-09 13:50:49 UTC
Fixed in CVS:

2006-06-09  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkrange.c: added new style properties "trough-side-details"
	and "draw-trough-under-steppers" and fixed the "stepper-spacing"
	style property. Fixes bugs #342339 and #342249.

	"draw-trough-under-steppers", when set to FALSE, starts trough
	drawing next to the steppers instead of drawing the trough "below"
	(around) the steppers. If "stepper-spacing" is set to any value
	larger than zero, "draw-trough-under-steppers" is set to FALSE
	automatically to avoid rendering an area that looks clickable but
	isn't.

	(gtk_range_calc_layout): honor draw-trough-under-steppers.
	Don't reserve stepper-spacing on sides of the range that don't
	have steppers.

	(gtk_range_expose): changed drawing accordingly. Implement
	"trough-side-details" which enables drawing of the upper and lower
	parts of the trough with different details. This is useful for
	theme engines which want to draw these parts differently.

	(coord_to_value): correctly take all rendering options into
	account. stepper-spacing > 0 caused jumping and otherwise
	strangely behaving ranges before.

	(other functions): changed accordingly.