[murrine] Small changes



commit 90686b6e13bdee26397ff1b4f508b983fd99aa8c
Author: Andrea Cimitan <andrea cimitan gmail com>
Date:   Wed Sep 16 03:30:23 2009 +0200

    Small changes

 src/murrine_draw.c  |   20 ++++++++++----------
 src/murrine_style.c |   11 +++++------
 2 files changed, 15 insertions(+), 16 deletions(-)
---
diff --git a/src/murrine_draw.c b/src/murrine_draw.c
index 6daecb1..3d35b2c 100644
--- a/src/murrine_draw.c
+++ b/src/murrine_draw.c
@@ -364,7 +364,6 @@ murrine_draw_entry_progress (cairo_t *cr,
 		clearlooks_rounded_rectangle (cr, x-10, y-10, width+10, height+10, radius, MRN_CORNER_ALL);
 		cairo_clip (cr);
 
-
 		murrine_set_color_rgb (cr, &fill);
 		clearlooks_rounded_rectangle (cr, x+1, y+1, width-2, height-2, radius, MRN_CORNER_ALL);
 		cairo_fill (cr);
@@ -412,13 +411,9 @@ murrine_scale_draw_gradient (cairo_t *cr,
 	int radius = MIN (roundness, MIN ((double)width/2.0, (double)height/2.0));
 
 	murrine_set_color_rgb (cr, c1);
-	clearlooks_rounded_rectangle (cr, x, y, width, height, radius, corners);
+	murrine_rounded_rectangle_closed (cr, x, y, width, height, radius, corners);
 	cairo_fill (cr);
 
-	murrine_set_color_rgb (cr, c2);
-	clearlooks_rounded_rectangle (cr, x, y, width, height, radius, corners);
-	cairo_stroke (cr);
-
 	if (lightborder_shade != 1.0)
 	{
 		cairo_pattern_t *pat;
@@ -427,7 +422,8 @@ murrine_scale_draw_gradient (cairo_t *cr,
 		MurrineRGB lightborder;
 		murrine_shade (c1, lightborder_shade, &lightborder);
 
-		clearlooks_rounded_rectangle (cr, x+1, y+1, width-2, height-2, radius-1, corners);
+		radius < 2 ? cairo_rectangle (cr, x, y, width, height) :
+		             clearlooks_rounded_rectangle (cr, x+1, y+1, width-2, height-2, radius-1, corners);
 		pat = cairo_pattern_create_linear (x+1, y+1, horizontal ? x+1 : width+x+1, horizontal ? height+y+1 : y+1);
 
 		murrine_pattern_add_color_stop_rgba (pat, 0.00,     &lightborder, 0.75);
@@ -440,6 +436,10 @@ murrine_scale_draw_gradient (cairo_t *cr,
 
 		cairo_stroke (cr);
 	}
+
+	murrine_set_color_rgb (cr, c2);
+	murrine_rounded_rectangle (cr, x, y, width, height, radius, corners);
+	cairo_stroke (cr);
 }
 
 #define TROUGH_SIZE 6
@@ -475,7 +475,7 @@ murrine_draw_scale_trough (cairo_t *cr,
 	cairo_translate (cr, translate_x+0.5, translate_y+0.5);
 
 	if (!slider->fill_level && widget->reliefstyle != 0)
-		murrine_draw_inset (cr, &widget->parentbg, 0, 0, trough_width, trough_height, widget->roundness, MRN_CORNER_ALL);
+		murrine_draw_inset (cr, &widget->parentbg, 0, 0, trough_width, trough_height, widget->roundness, widget->corners);
 
 	if (!slider->lower && !slider->fill_level)
 	{
@@ -486,7 +486,7 @@ murrine_draw_scale_trough (cairo_t *cr,
 		murrine_scale_draw_gradient (cr, &fill, &border,
 		                             1.0,
 		                             widget->lightborderstyle,
-		                             widget->roundness, MRN_CORNER_ALL,
+		                             widget->roundness, widget->corners,
 		                             1.0, 1.0, trough_width-2, trough_height-2,
 		                             slider->horizontal);
 	}
@@ -495,7 +495,7 @@ murrine_draw_scale_trough (cairo_t *cr,
 		murrine_scale_draw_gradient (cr, &colors->spot[1], &colors->spot[2],
 		                             widget->disabled ? 1.0 : widget->lightborder_shade,
 		                             widget->lightborderstyle,
-		                             widget->roundness, MRN_CORNER_ALL,
+		                             widget->roundness, widget->corners,
 		                             1.0, 1.0, trough_width-2, trough_height-2,
 		                             slider->horizontal);
 	}
diff --git a/src/murrine_style.c b/src/murrine_style.c
index 0065d43..9a76024 100644
--- a/src/murrine_style.c
+++ b/src/murrine_style.c
@@ -1827,7 +1827,7 @@ murrine_style_draw_expander (GtkStyle        *style,
 	else
 		expander_size = 13;
 
-	if (expander_size %2 == 0)
+	if (expander_size % 2 == 0)
 		expander_size--;
 
 	cairo_translate (cr, x-expander_size/2, y-expander_size/2);
@@ -1844,10 +1844,6 @@ murrine_style_draw_expander (GtkStyle        *style,
 
 	cairo_restore (cr);
 
-	murrine_rounded_rectangle (cr, 0.5, 0.5, expander_size-1, expander_size-1, params.roundness, params.corners);
-	murrine_set_color_rgb (cr, &colors->shade[4]);
-	cairo_stroke (cr);
-
 	switch (expander_style)
 	{
 		case GTK_EXPANDER_SEMI_COLLAPSED:
@@ -1865,10 +1861,13 @@ murrine_style_draw_expander (GtkStyle        *style,
 		default:
 			g_assert_not_reached ();
 	}
-
 	murrine_set_color_rgb  (cr, &colors->fg[state_type]);
 	cairo_stroke (cr);
 
+	murrine_rounded_rectangle (cr, 0.5, 0.5, expander_size-1, expander_size-1, params.roundness, params.corners);
+	murrine_set_color_rgb (cr, &colors->shade[4]);
+	cairo_stroke (cr);
+
 	cairo_destroy (cr);
 }
 



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