gtk-engines r1172 - in trunk: . engines/clearlooks/src
- From: bberg svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk-engines r1172 - in trunk: . engines/clearlooks/src
- Date: Tue, 6 May 2008 19:53:13 +0100 (BST)
Author: bberg
Date: Tue May 6 18:53:13 2008
New Revision: 1172
URL: http://svn.gnome.org/viewvc/gtk-engines?rev=1172&view=rev
Log:
2008-05-06 Benjamin Berg <benjamin sipsolutions net>
* engines/clearlooks/src/clearlooks_style.c:
(clearlooks_style_draw_box):
Only decrease the size of the scrollbar trough if the
trough-under-steppers style property is set and steppers are present.
Fixes bug #531633.
Modified:
trunk/ChangeLog
trunk/engines/clearlooks/src/clearlooks_style.c
Modified: trunk/engines/clearlooks/src/clearlooks_style.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_style.c (original)
+++ trunk/engines/clearlooks/src/clearlooks_style.c Tue May 6 18:53:13 2008
@@ -648,6 +648,7 @@
{
WidgetParameters params;
ScrollBarParameters scrollbar;
+ gboolean trough_under_steppers = TRUE;
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
params.corners = CR_CORNER_ALL;
@@ -663,16 +664,42 @@
else /* Fallback based on the size ... */
scrollbar.horizontal = width >= height;
- /* What is this about? */
- if (scrollbar.horizontal)
- {
- x += 2;
- width -= 4;
- }
- else
- {
- y += 2;
- height -= 4;
+ if (widget)
+ gtk_widget_style_get (widget,
+ "trough-under-steppers", &trough_under_steppers,
+ NULL);
+
+ if (trough_under_steppers)
+ {
+ /* If trough under steppers is set, then we decrease the size
+ * slightly. The size is decreased so that the trough is not
+ * visible underneath the steppers. This is not really needed
+ * as one can use the trough-under-steppers style property,
+ * but it needs to exist for backward compatibility. */
+ if (scrollbar.horizontal)
+ {
+ if (scrollbar.junction & CL_JUNCTION_BEGIN)
+ {
+ x += 2;
+ width -= 2;
+ }
+ if (scrollbar.junction & CL_JUNCTION_END)
+ {
+ width -= 2;
+ }
+ }
+ else
+ {
+ if (scrollbar.junction & CL_JUNCTION_END)
+ {
+ y += 2;
+ height -= 2;
+ }
+ if (scrollbar.junction & CL_JUNCTION_END)
+ {
+ height -= 2;
+ }
+ }
}
STYLE_FUNCTION(draw_scrollbar_trough) (cr, colors, ¶ms, &scrollbar,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]