[gtk-engines] Proper stepper drawing for gtk+ master.



commit 7203c68bb542dd34e898b5a65aa341fd91e1519d
Author: Benjamin Berg <benjamin sipsolutions net>
Date:   Tue Jun 29 22:39:39 2010 +0200

    Proper stepper drawing for gtk+ master.

 engines/clearlooks/src/clearlooks_draw.c          |   12 ++++++------
 engines/clearlooks/src/clearlooks_draw_glossy.c   |   12 ++++++------
 engines/clearlooks/src/clearlooks_draw_gummy.c    |   12 ++++++------
 engines/clearlooks/src/clearlooks_draw_inverted.c |   12 ++++++------
 engines/clearlooks/src/clearlooks_style.c         |    6 ++++--
 engines/clearlooks/src/clearlooks_types.h         |    9 +++++----
 themes/Clearlooks/gtk-3.0/gtkrc-common            |    1 +
 themes/GNOME3/gtk-3.0/gtkrc                       |    1 +
 8 files changed, 35 insertions(+), 30 deletions(-)
---
diff --git a/engines/clearlooks/src/clearlooks_draw.c b/engines/clearlooks/src/clearlooks_draw.c
index 56a142e..fe107c3 100644
--- a/engines/clearlooks/src/clearlooks_draw.c
+++ b/engines/clearlooks/src/clearlooks_draw.c
@@ -1760,15 +1760,15 @@ clearlooks_draw_scrollbar_stepper (cairo_t *cr,
 		else if (stepper->stepper == CL_STEPPER_END)
 			corners = CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMRIGHT;
 
-/*		if (stepper->stepper == CL_STEPPER_B)
+		if (stepper->stepper == CL_STEPPER_START_INNER)
 		{
 			x -= 1;
 			width += 1;
 		}
-		else if (stepper->stepper == CL_STEPPER_C)
+		else if (stepper->stepper == CL_STEPPER_END_INNER)
 		{
 			width += 1;
-		}*/
+		}
 	}
 	else
 	{
@@ -1777,15 +1777,15 @@ clearlooks_draw_scrollbar_stepper (cairo_t *cr,
 		else if (stepper->stepper == CL_STEPPER_END)
 			corners = CR_CORNER_BOTTOMLEFT | CR_CORNER_BOTTOMRIGHT;
 
-/*		if (stepper->stepper == CL_STEPPER_B)
+		if (stepper->stepper == CL_STEPPER_START_INNER)
 		{
 			y -= 1;
 			height += 1;
 		}
-		else if (stepper->stepper == CL_STEPPER_C)
+		else if (stepper->stepper == CL_STEPPER_END_INNER)
 		{
 			height += 1;
-		}*/
+		}
 	}
 
 	cairo_translate (cr, x, y);
diff --git a/engines/clearlooks/src/clearlooks_draw_glossy.c b/engines/clearlooks/src/clearlooks_draw_glossy.c
index 232363e..937a022 100644
--- a/engines/clearlooks/src/clearlooks_draw_glossy.c
+++ b/engines/clearlooks/src/clearlooks_draw_glossy.c
@@ -933,15 +933,15 @@ clearlooks_glossy_draw_scrollbar_stepper (cairo_t *cr,
 		else if (stepper->stepper == CL_STEPPER_END)
 			corners = CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMRIGHT;
 
-/*		if (stepper->stepper == CL_STEPPER_B)
+		if (stepper->stepper == CL_STEPPER_START_INNER)
 		{
 			x -= 1;
 			width += 1;
 		}
-		else if (stepper->stepper == CL_STEPPER_C)
+		else if (stepper->stepper == CL_STEPPER_END_INNER)
 		{
 			width += 1;
-		}*/
+		}
 	}
 	else
 	{
@@ -950,15 +950,15 @@ clearlooks_glossy_draw_scrollbar_stepper (cairo_t *cr,
 		else if (stepper->stepper == CL_STEPPER_END)
 			corners = CR_CORNER_BOTTOMLEFT | CR_CORNER_BOTTOMRIGHT;
 
-/*		if (stepper->stepper == CL_STEPPER_B)
+		if (stepper->stepper == CL_STEPPER_START_INNER)
 		{
 			y -= 1;
 			height += 1;
 		}
-		else if (stepper->stepper == CL_STEPPER_C)
+		else if (stepper->stepper == CL_STEPPER_END_INNER)
 		{
 			height += 1;
-		}*/
+		}
 	}
 	
 	cairo_translate (cr, x, y);
diff --git a/engines/clearlooks/src/clearlooks_draw_gummy.c b/engines/clearlooks/src/clearlooks_draw_gummy.c
index 7965c5d..92f7c59 100644
--- a/engines/clearlooks/src/clearlooks_draw_gummy.c
+++ b/engines/clearlooks/src/clearlooks_draw_gummy.c
@@ -997,15 +997,15 @@ clearlooks_gummy_draw_scrollbar_stepper (cairo_t                          *cr,
 		else if (stepper->stepper == CL_STEPPER_END)
 			corners = CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMRIGHT;
 
-/*		if (stepper->stepper == CL_STEPPER_B)
+		if (stepper->stepper == CL_STEPPER_START_INNER)
 		{
 			x -= 1;
 			width += 1;
 		}
-		else if (stepper->stepper == CL_STEPPER_C)
+		else if (stepper->stepper == CL_STEPPER_END_INNER)
 		{
 			width += 1;
-		}*/
+		}
 	}
 	else
 	{
@@ -1014,15 +1014,15 @@ clearlooks_gummy_draw_scrollbar_stepper (cairo_t                          *cr,
 		else if (stepper->stepper == CL_STEPPER_END)
 			corners = CR_CORNER_BOTTOMLEFT | CR_CORNER_BOTTOMRIGHT;
 
-/*		if (stepper->stepper == CL_STEPPER_B)
+		if (stepper->stepper == CL_STEPPER_START_INNER)
 		{
 			y -= 1;
 			height += 1;
 		}
-		else if (stepper->stepper == CL_STEPPER_C)
+		else if (stepper->stepper == CL_STEPPER_END_INNER)
 		{
 			height += 1;
-		}*/
+		}
 	}
 
 	cairo_translate (cr, x, y);
diff --git a/engines/clearlooks/src/clearlooks_draw_inverted.c b/engines/clearlooks/src/clearlooks_draw_inverted.c
index 5ee14e4..bb1f97d 100644
--- a/engines/clearlooks/src/clearlooks_draw_inverted.c
+++ b/engines/clearlooks/src/clearlooks_draw_inverted.c
@@ -773,15 +773,15 @@ clearlooks_inverted_draw_scrollbar_stepper (cairo_t *cr,
 		else if (stepper->stepper == CL_STEPPER_END)
 			corners = CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMRIGHT;
 
-/*		if (stepper->stepper == CL_STEPPER_B)
+		if (stepper->stepper == CL_STEPPER_START_INNER)
 		{
 			x -= 1;
 			width += 1;
 		}
-		else if (stepper->stepper == CL_STEPPER_C)
+		else if (stepper->stepper == CL_STEPPER_END_INNER)
 		{
 			width += 1;
-		}*/
+		}
 	}
 	else
 	{
@@ -790,15 +790,15 @@ clearlooks_inverted_draw_scrollbar_stepper (cairo_t *cr,
 		else if (stepper->stepper == CL_STEPPER_END)
 			corners = CR_CORNER_BOTTOMLEFT | CR_CORNER_BOTTOMRIGHT;
 
-/*		if (stepper->stepper == CL_STEPPER_B)
+		if (stepper->stepper == CL_STEPPER_START_INNER)
 		{
 			y -= 1;
 			height += 1;
 		}
-		else if (stepper->stepper == CL_STEPPER_C)
+		else if (stepper->stepper == CL_STEPPER_END_INNER)
 		{
 			height += 1;
-		}*/
+		}
 	}
 	
 	cairo_translate (cr, x, y);
diff --git a/engines/clearlooks/src/clearlooks_style.c b/engines/clearlooks/src/clearlooks_style.c
index 3982e85..1c02499 100644
--- a/engines/clearlooks/src/clearlooks_style.c
+++ b/engines/clearlooks/src/clearlooks_style.c
@@ -1027,8 +1027,10 @@ clearlooks_style_draw_box (DRAW_ARGS)
 			stepper.stepper = CL_STEPPER_START;
 		else if (g_str_equal(detail + 10, "_end"))
 			stepper.stepper = CL_STEPPER_END;
-		else if (g_str_equal(detail + 10, "_middle"))
-			stepper.stepper = CL_STEPPER_MIDDLE;
+		else if (g_str_equal(detail + 10, "_start_inner"))
+			stepper.stepper = CL_STEPPER_START_INNER;
+		else if (g_str_equal(detail + 10, "_end_inner"))
+			stepper.stepper = CL_STEPPER_END_INNER;
 		else
 			stepper.stepper = CL_STEPPER_UNKNOWN;
 
diff --git a/engines/clearlooks/src/clearlooks_types.h b/engines/clearlooks/src/clearlooks_types.h
index f1414d0..affb505 100644
--- a/engines/clearlooks/src/clearlooks_types.h
+++ b/engines/clearlooks/src/clearlooks_types.h
@@ -50,10 +50,11 @@ typedef enum
 
 typedef enum
 {
-	CL_STEPPER_UNKNOWN    = 0,
-	CL_STEPPER_START      = 1,
-	CL_STEPPER_MIDDLE     = 2,
-	CL_STEPPER_END        = 4,
+	CL_STEPPER_UNKNOWN,
+	CL_STEPPER_START,
+	CL_STEPPER_START_INNER,
+	CL_STEPPER_END,
+	CL_STEPPER_END_INNER,
 } ClearlooksStepper;
 
 typedef enum
diff --git a/themes/Clearlooks/gtk-3.0/gtkrc-common b/themes/Clearlooks/gtk-3.0/gtkrc-common
index 208d206..c6a1fdd 100644
--- a/themes/Clearlooks/gtk-3.0/gtkrc-common
+++ b/themes/Clearlooks/gtk-3.0/gtkrc-common
@@ -16,6 +16,7 @@ style "default" {
 
 	GtkPaned::handle-size = 6
 
+	GtkRange::stepper-position-details = 1
 	GtkRange::trough-under-steppers = 0
 	GtkRange::trough-border = 0
 	GtkRange::slider-width = 15
diff --git a/themes/GNOME3/gtk-3.0/gtkrc b/themes/GNOME3/gtk-3.0/gtkrc
index 12f3b7e..c2e2af2 100644
--- a/themes/GNOME3/gtk-3.0/gtkrc
+++ b/themes/GNOME3/gtk-3.0/gtkrc
@@ -36,6 +36,7 @@ style "default" {
 	# up so that the whole area is sensitive to button presses for the
 	# slider. The stepper button is larger in both directions, the slider
 	# only in the width
+	GtkRange::stepper-position-details = 1
 	GtkRange::trough-border = 0
 	GtkRange::slider-width = 20
 	GtkRange::stepper-size = 20



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]