murrine r78 - in trunk: . src



Author: acimitan
Date: Sat Sep 27 13:49:55 2008
New Revision: 78
URL: http://svn.gnome.org/viewvc/murrine?rev=78&view=rev

Log:
2008-09-27  Andrea Cimitan  <andrea cimitan gmail com>

	* src/murrine_draw.c (murrine_draw_highlight_and_shade),
	(murrine_draw_button), (murrine_draw_entry),
	(murrine_draw_spinbutton_down), (murrine_scale_draw_gradient),
	(murrine_draw_optionmenu), (murrine_draw_menubar),
	(murrine_draw_frame), (murrine_draw_tab),
	(murrine_draw_list_view_header), (murrine_draw_toolbar),
	(murrine_draw_menuitem), (murrine_draw_scrollbar_trough),
	(murrine_draw_scrollbar_stepper), (murrine_draw_scrollbar_slider),
	(murrine_draw_selected_cell), (murrine_draw_menu_frame),
	(murrine_draw_radiobutton), (murrine_draw_checkbox):
	* src/murrine_draw_rgba.c (murrine_draw_highlight_and_shade),
	(murrine_rgba_draw_button), (murrine_rgba_draw_entry),
	(murrine_scale_draw_gradient),
	(murrine_rgba_draw_progressbar_trough),
	(murrine_rgba_draw_menubar), (murrine_rgba_draw_toolbar),
	(murrine_rgba_draw_frame), (murrine_rgba_draw_tab),
	(murrine_rgba_draw_scrollbar_trough),
	(murrine_rgba_draw_scrollbar_stepper),
	(murrine_rgba_draw_scrollbar_slider), (murrine_rgba_draw_handle),
	(murrine_rgba_draw_radiobutton), (murrine_rgba_draw_checkbox),
	(murrine_rgba_draw_menu_frame):
	Polishing code - Part 1


Modified:
   trunk/ChangeLog
   trunk/src/murrine_draw.c
   trunk/src/murrine_draw_rgba.c

Modified: trunk/src/murrine_draw.c
==============================================================================
--- trunk/src/murrine_draw.c	(original)
+++ trunk/src/murrine_draw.c	Sat Sep 27 13:49:55 2008
@@ -93,6 +93,8 @@
 	uint8 corners = widget->corners;
 	double x = 1.0;
 	double y = 1.0;
+	width  -= 3;
+	height -= 3;
 
 	if (radius < 0)
 		radius = 0;
@@ -100,9 +102,6 @@
 	murrine_shade (&colors->bg[0], 1.04, &highlight);
 	murrine_shade (&colors->bg[0], 0.96, &shadow);
 
-	width  -= 3;
-	height -= 3;
-
 	cairo_save (cr);
 
 	/* Top/Left highlight */
@@ -148,7 +147,8 @@
                      int x, int y, int width, int height,
                      boolean horizontal)
 {
-	double xos = 0, yos = 0;
+	double xos = widget->xthickness > 2 ? 1 : 0;
+	double yos = widget->ythickness > 2 ? 1 : 0;
 	MurrineRGB fill = colors->bg[widget->state_type];
 	MurrineRGB border_disabled = colors->shade[5];
 	MurrineRGB border_normal;
@@ -174,11 +174,6 @@
 	cairo_translate (cr, x, y);
 	cairo_set_line_width (cr, 1.0);
 
-	if (widget->xthickness > 2)
-		xos = 1;
-	if (widget->ythickness > 2)
-		yos = 1;
-
 	/* Start drawing the inset/shadow */
 	if (!widget->active && !widget->disabled && widget->reliefstyle > 1)
 	{
@@ -223,7 +218,7 @@
 	else
 	{
 		cairo_fill (cr);
-		murrine_draw_flat_highlight (cr, xos + 1, yos + 1, width-(xos*2)-2, height-(yos*2)-2);
+		murrine_draw_flat_highlight (cr, xos+1, yos+1, width-(xos*2)-2, height-(yos*2)-2);
 	}
 
 	murrine_set_gradient (cr, &highlight, mrn_gradient_custom, xos+1, yos+1, 0, height-(yos*2)-2, widget->mrn_gradient.gradients, TRUE);
@@ -310,14 +305,9 @@
                     int x, int y, int width, int height)
 {
 	const MurrineRGB *base = &colors->base[widget->state_type];
-	MurrineRGB *border;
+	const MurrineRGB *border = &colors->shade[widget->disabled ? 4 : 6];
 	int radius = CLAMP (widget->roundness, 0, 3);
 
-	if (widget->focus)
-		border = (MurrineRGB*)&colors->spot[2];
-	else
-		border = (MurrineRGB*)&colors->shade[widget->disabled ? 4 : 6];
-
 	cairo_translate (cr, x+0.5, y+0.5);
 	cairo_set_line_width (cr, 1.0);
 
@@ -350,7 +340,7 @@
 	}
 
 	/* Draw the border */
-	murrine_set_color_rgb (cr, border);
+	murrine_set_color_rgb (cr, widget->focus ? &colors->spot[2] : border);
 	murrine_rounded_rectangle (cr, 1, 1, width-3, height-3, radius, widget->corners);
 	cairo_stroke (cr);
 }
@@ -361,10 +351,10 @@
                               const WidgetParameters *widget,
                               int x, int y, int width, int height)
 {
+	cairo_pattern_t *pattern;
 	MurrineRGB shadow;
-	murrine_shade (&colors->bg[0], 0.8, &shadow);
 
-	cairo_pattern_t *pattern;
+	murrine_shade (&colors->bg[0], 0.8, &shadow);
 
 	cairo_translate (cr, x+1, y+1);
 
@@ -373,7 +363,6 @@
 	pattern = cairo_pattern_create_linear (0, 0, 0, height);
 	cairo_pattern_add_color_stop_rgb (pattern, 0.0, shadow.r, shadow.g, shadow.b);
 	cairo_pattern_add_color_stop_rgba (pattern, 1.0, shadow.r, shadow.g, shadow.b, 0.0);
-
 	cairo_set_source (cr, pattern);
 	cairo_fill (cr);
 
@@ -387,16 +376,12 @@
                              int x, int y, int width, int height,
                              boolean alpha)
 {
-	if (alpha)
-		murrine_set_color_rgba (cr, c1, 0.44);
-	else
-		murrine_set_color_rgb (cr, c1);
-
+	murrine_set_color_rgba (cr, c1, alpha ? 0.44 : 1);
 	cairo_rectangle (cr, x, y, width, height);
 	cairo_fill (cr);
 
-	cairo_rectangle (cr, x, y, width, height);
 	murrine_set_color_rgba (cr, c2, 0.8);
+	cairo_rectangle (cr, x, y, width, height);
 	cairo_stroke (cr);
 }
 
@@ -582,7 +567,7 @@
 	}
 	else
 	{
-		int tmp = height; height  = width; width   = tmp;
+		int tmp = height; height = width; width = tmp;
 
 		x = x + 1;
 		y = y - 1;
@@ -683,9 +668,9 @@
 	cairo_set_line_width   (cr, 1.0);
 	cairo_translate        (cr, optionmenu->linepos+0.5, 1);
 
+	murrine_set_color_rgba (cr, dark, 0.4);
 	cairo_move_to          (cr, 0.0, offset);
 	cairo_line_to          (cr, 0.0, height - offset - widget->ythickness + 1);
-	murrine_set_color_rgba (cr, dark, 0.4);
 	cairo_stroke           (cr);
 }
 
@@ -696,15 +681,18 @@
                       int x, int y, int width, int height,
                       int menubarstyle)
 {
+	const MurrineRGB *fill = &colors->bg[0];
+
 	cairo_translate (cr, x, y);
 	cairo_rectangle (cr, 0, 0, width, height);
-	const MurrineRGB *fill = &colors->bg[0];
 
 	if (menubarstyle == 1) /* Glass menubar */
 	{
 		MurrineRGB highlight;
-		murrine_set_gradient (cr, fill, widget->mrn_gradient, 0, 0, 0, height, widget->mrn_gradient.gradients, FALSE);
+
 		murrine_shade (fill, widget->highlight_ratio, &highlight);
+
+		murrine_set_gradient (cr, fill, widget->mrn_gradient, 0, 0, 0, height, widget->mrn_gradient.gradients, FALSE);
 		/* The glass effect */
 		if (widget->glazestyle > 0)
 		{
@@ -852,10 +840,9 @@
 	MurrineRGB *border = frame->border;
 	MurrineRectangle bevel_clip;
 	MurrineRectangle frame_clip;
-
 	const MurrineRGB *dark = &colors->shade[3];
-
 	MurrineRGB highlight, shadow_color;
+
 	murrine_shade (&colors->bg[0], 1.04, &highlight);
 	murrine_shade (&colors->bg[0], 0.96, &shadow_color);
 
@@ -941,7 +928,7 @@
 	const MurrineRGB *stripe_fill = &colors->spot[1];
 	const MurrineRGB *stripe_border = &colors->spot[2];
 	const MurrineRGB *fill = &colors->bg[widget->state_type];
-	MurrineRGB       *border = (MurrineRGB*)&colors->shade[!widget->active ? 5 : 4];
+	const MurrineRGB *border = &colors->shade[!widget->active ? 5 : 4];
 	cairo_pattern_t* pattern;
 
 	/* Set clip */
@@ -1210,14 +1197,15 @@
 	else
 		cairo_move_to (cr, 0.0, 0.5);
 
-	cairo_line_to (cr, width, 0.5);
 	murrine_set_color_rgb (cr, &highlight);
+	cairo_line_to (cr, width, 0.5);
 	cairo_stroke (cr);
 
 	/* Effects */
 	if (header->style > 0)
 	{
 		MurrineRGB highlight_header;
+
 		murrine_shade (fill, widget->highlight_ratio, &highlight_header);
 		/* Glassy header */
 		if (header->style == 1)
@@ -1340,8 +1328,10 @@
 	if (toolbar->style == 1)
 	{
 		MurrineRGB highlight;
-		murrine_set_gradient (cr, fill, widget->mrn_gradient, 0, 0, 0, height, widget->mrn_gradient.gradients, FALSE);
+
 		murrine_shade (fill, widget->highlight_ratio, &highlight);
+
+		murrine_set_gradient (cr, fill, widget->mrn_gradient, 0, 0, 0, height, widget->mrn_gradient.gradients, FALSE);
 		/* Glass effect */
 		if (widget->glazestyle > 0)
 		{
@@ -1487,8 +1477,9 @@
 	else
 	{
 		cairo_fill (cr);
-		murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners);
+
 		murrine_set_color_rgba (cr, border, 0.15);
+		murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners);
 		cairo_fill_preserve (cr);
 	}
 	murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners);
@@ -1523,13 +1514,13 @@
 	}
 
 	/* Draw fill */
-	clearlooks_rounded_rectangle (cr, 1, 0, width-2, height, widget->roundness, widget->corners);
 	murrine_set_color_rgba (cr, &fill, 0.4);
+	clearlooks_rounded_rectangle (cr, 1, 0, width-2, height, widget->roundness, widget->corners);
 	cairo_fill (cr);
 
 	/* Draw border */
-	murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners);
 	murrine_set_color_rgba (cr, border, 0.8);
+	murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners);
 	cairo_stroke (cr);
 }
 
@@ -1608,7 +1599,6 @@
 	cairo_restore (cr);
 
 	murrine_set_color_rgb (cr, &border_normal);
-	/* Draw the border */
 	murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners);
 	cairo_stroke (cr);
 }
@@ -1645,16 +1635,12 @@
 	}
 
 	/* Set colors */
-	MurrineRGB fill;
-	if (scrollbar->has_color)
-		fill = scrollbar->color;
-	else
-		fill = colors->bg[0];
-
+	MurrineRGB fill = scrollbar->has_color ? scrollbar->color : colors->bg[0];
 	MurrineRGB border;
-	murrine_shade (&colors->shade[6], 0.95, &border);
 	MurrineRGB highlight;
 
+	murrine_shade (&colors->shade[6], 0.95, &border);
+
 	if (widget->prelight)
 		murrine_shade (&fill, 1.06, &fill);
 
@@ -1674,8 +1660,8 @@
 
 	cairo_set_line_width (cr, 1.0);
 
-	murrine_rounded_rectangle_fast (cr, 0.5, 0.5, width-1, height-1, widget->corners);
 	murrine_set_color_rgb (cr, &border);
+	murrine_rounded_rectangle_fast (cr, 0.5, 0.5, width-1, height-1, widget->corners);
 	cairo_stroke (cr);
 
 	cairo_rectangle (cr, 1, 1, width-2, height-2);
@@ -1807,22 +1793,18 @@
 {
 	cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
 	cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER);
+	MurrineRGB fill = widget->focus ? colors->base[widget->state_type] :
+	                                  colors->base[GTK_STATE_ACTIVE];
+	MurrineRGB border;
 
-	MurrineRGB fill;
 	cairo_save (cr);
 
 	cairo_translate (cr, x, y);
 
-	if (widget->focus)
-		fill = colors->base[widget->state_type];
-	else
-		fill = colors->base[GTK_STATE_ACTIVE];
-
 	murrine_set_gradient (cr, &fill, widget->mrn_gradient, 0, 0, 0, height, widget->mrn_gradient.gradients, FALSE);
 	cairo_rectangle (cr, 0, 0, width, height);
 	cairo_fill (cr);
 
-	MurrineRGB border;
 	murrine_shade (&fill, (!widget->mrn_gradient.gradients ? 0.9 : 0.95), &border);
 
 	cairo_move_to  (cr, 0, 0.5);
@@ -1870,8 +1852,9 @@
 
 	cairo_translate       (cr, x, y);
 	cairo_set_line_width  (cr, 1);
-	cairo_rectangle       (cr, 0.5, 0.5, width-1, height-1);
+
 	murrine_set_color_rgb (cr, border);
+	cairo_rectangle       (cr, 0.5, 0.5, width-1, height-1);
 	cairo_stroke          (cr);
 
 	/* Broken with RTL */
@@ -1882,8 +1865,8 @@
 		MurrineRGB border2;
 		murrine_shade (fill, 0.5, &border2);
 
-		cairo_rectangle (cr, 0.5, 0.5, 3, height-1);
 		murrine_set_color_rgb (cr, &border2);
+		cairo_rectangle (cr, 0.5, 0.5, 3, height-1);
 		cairo_stroke_preserve (cr);
 
 		murrine_set_color_rgb (cr, fill);
@@ -2168,16 +2151,16 @@
 			cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
 			cairo_set_line_width (cr, 2);
 
+			murrine_set_color_rgba (cr, dot, trans);
 			cairo_move_to(cr, 5, 7);
 			cairo_line_to(cr, 9, 7);
-
-			murrine_set_color_rgba (cr, dot, trans);
 			cairo_stroke (cr);
 		}
 		else
 		{
-			cairo_arc (cr, 7, 7, 3, 0, G_PI*2);
+		
 			murrine_set_color_rgba (cr, dot, trans);
+			cairo_arc (cr, 7, 7, 3, 0, G_PI*2);
 			cairo_fill (cr);
 		}
 	}
@@ -2225,8 +2208,8 @@
 	{
 		if (widget->reliefstyle > 1)
 		{
-			cairo_rectangle (cr, 0.5, 0.5, width-1, height-1);
 			murrine_set_color_rgba (cr, &shadow, 0.15);
+			cairo_rectangle (cr, 0.5, 0.5, width-1, height-1);
 			cairo_stroke (cr);
 		}
 

Modified: trunk/src/murrine_draw_rgba.c
==============================================================================
--- trunk/src/murrine_draw_rgba.c	(original)
+++ trunk/src/murrine_draw_rgba.c	Sat Sep 27 13:49:55 2008
@@ -91,15 +91,14 @@
 	uint8 corners = widget->corners;
 	double x = 1.0;
 	double y = 1.0;
-
-	murrine_shade (&colors->bg[0], 1.15, &highlight);
-	murrine_shade (&colors->bg[0], 0.4, &shadow);
+	width  -= 3;
+	height -= 3;
 
 	if (radius < 0)
 		radius = 0;
 
-	width  -= 3;
-	height -= 3;
+	murrine_shade (&colors->bg[0], 1.15, &highlight);
+	murrine_shade (&colors->bg[0], 0.4, &shadow);
 
 	cairo_save (cr);
 
@@ -146,7 +145,8 @@
                           int x, int y, int width, int height,
                           boolean horizontal)
 {
-	double xos = 0, yos = 0;
+	double xos = widget->xthickness > 2 ? 1 : 0;
+	double yos = widget->ythickness > 2 ? 1 : 0;
 	MurrineRGB fill = colors->bg[widget->state_type];
 	MurrineRGB border_disabled = colors->shade[6];
 	MurrineRGB border_normal;
@@ -172,11 +172,6 @@
 	cairo_translate (cr, x, y);
 	cairo_set_line_width (cr, 1.0);
 
-	if (widget->xthickness > 2)
-		xos = 1;
-	if (widget->ythickness > 2)
-		yos = 1;
-
 	if (!widget->active && !widget->disabled && widget->reliefstyle > 1)
 	{
 		murrine_rounded_rectangle (cr, xos, yos, width-(xos*2), height-(yos*2), widget->roundness, widget->corners);
@@ -225,7 +220,7 @@
 	else
 	{
 		cairo_fill (cr);
-		murrine_draw_flat_highlight (cr, xos + 1, yos + 1, width-(xos*2)-2, height-(yos*2)-2);
+		murrine_draw_flat_highlight (cr, xos+1, yos+1, width-(xos*2)-2, height-(yos*2)-2);
 	}
 
 	murrine_set_gradient (cr, &highlight, mrn_gradient_custom, xos+1, yos+1, 0, height-(yos*2)-2, widget->mrn_gradient.gradients, TRUE);
@@ -314,16 +309,12 @@
                          const WidgetParameters *widget,
                          int x, int y, int width, int height)
 {
+	double xos = widget->xthickness > 1 ? 1 : 0;
+	double yos = widget->ythickness > 1 ? 1 : 0;
 	const MurrineRGB *base = &colors->base[widget->state_type];
 	MurrineRGB border = colors->shade[widget->disabled ? 4 : 5];
-	int xos, yos = 0;
 	int radius = CLAMP (widget->roundness, 0, 3);
 
-	if (widget->xthickness > 1)
-		xos = 1;
-	if (widget->ythickness > 1)
-		yos = 1;
-
 	murrine_shade (&border, 0.92, &border);
 
 	cairo_translate (cr, x+0.5, y+0.5);
@@ -366,12 +357,7 @@
 		cairo_stroke (cr);
 	}
 
-	/* Draw the border */
-	if (widget->focus)
-		murrine_set_color_rgb (cr, &colors->spot[2]);
-	else
-		murrine_set_color_rgb (cr, &border);
-
+	murrine_set_color_rgb (cr, widget->focus ? &colors->spot[2] : &border);
 	murrine_rounded_rectangle (cr, 1, 1, width-3, height-3, radius, widget->corners);
 	cairo_stroke (cr);
 }
@@ -383,16 +369,12 @@
                              int x, int y, int width, int height,
                              boolean alpha)
 {
-	if (alpha)
-		murrine_set_color_rgba (cr, c1, 0.46);
-	else
-		murrine_set_color_rgb (cr, c1);
-
+	murrine_set_color_rgba (cr, c1, alpha ? 0.46 : 1.0);
 	cairo_rectangle (cr, x, y, width, height);
 	cairo_fill (cr);
 
-	cairo_rectangle (cr, x, y, width, height);
 	murrine_set_color_rgba (cr, c2, 0.82);
+	cairo_rectangle (cr, x, y, width, height);
 	cairo_stroke (cr);
 }
 
@@ -478,13 +460,13 @@
 	cairo_set_line_width (cr, 1.0);
 
 	/* Create trough box */
-	cairo_rectangle (cr, x+1, y+1, width-2, height-2);
 	murrine_set_color_rgba (cr, &fill, 0.8);
+	cairo_rectangle (cr, x+1, y+1, width-2, height-2);
 	cairo_fill (cr);
 
 	/* Draw border */
-	cairo_rectangle (cr, x+0.5, y+0.5, width-1, height-1);
 	murrine_set_color_rgba (cr, border, 0.8);
+	cairo_rectangle (cr, x+0.5, y+0.5, width-1, height-1);
 	cairo_stroke (cr);
 
 	if (widget->mrn_gradient.gradients)
@@ -543,7 +525,7 @@
 	}
 	else
 	{
-		int tmp = height; height  = width; width   = tmp;
+		int tmp = height; height = width; width = tmp;
 
 		x = x + 1;
 		y = y - 1;
@@ -648,9 +630,10 @@
 	{
 		/* XXX: should use another gradient rgba_opacity */
 		MurrineRGB highlight;
-		murrine_set_gradient (cr, fill, widget->mrn_gradient, 0, 0, 0, height, widget->mrn_gradient.gradients, FALSE);
+
 		murrine_shade (fill, widget->highlight_ratio, &highlight);
 
+		murrine_set_gradient (cr, fill, widget->mrn_gradient, 0, 0, 0, height, widget->mrn_gradient.gradients, FALSE);
 		if (widget->glazestyle > 0)
 		{
 			widget->glazestyle == 2 ? cairo_fill_preserve (cr) : cairo_fill (cr);
@@ -794,9 +777,10 @@
 	{
 		/* XXX: should use another gradient rgba_opacity */
 		MurrineRGB highlight;
-		murrine_set_gradient (cr, fill, widget->mrn_gradient, 0, 0, 0, height, widget->mrn_gradient.gradients, FALSE);
+
 		murrine_shade (fill, widget->highlight_ratio, &highlight);
 
+		murrine_set_gradient (cr, fill, widget->mrn_gradient, 0, 0, 0, height, widget->mrn_gradient.gradients, FALSE);
 		/* Glass effect */
 		if (widget->glazestyle > 0)
 		{
@@ -911,9 +895,7 @@
 	MurrineRGB *border = frame->border;
 	MurrineRectangle bevel_clip;
 	MurrineRectangle frame_clip;
-
 	const MurrineRGB *dark = &colors->shade[5];
-
 	MurrineRGB highlight, shadow_color;
 
 	murrine_shade (&colors->bg[0], 1.15, &highlight);
@@ -1047,7 +1029,7 @@
 	const MurrineRGB *stripe_fill = &colors->spot[1];
 	const MurrineRGB *stripe_border = &colors->spot[2];
 	const MurrineRGB *fill = &colors->bg[widget->state_type];
-	MurrineRGB       *border = (MurrineRGB*)&colors->shade[!widget->active ? 5 : 4];
+	const MurrineRGB *border = &colors->shade[!widget->active ? 5 : 4];
 	cairo_pattern_t* pattern;
 
 	/* Set clip */
@@ -1271,13 +1253,13 @@
 	}
 
 	/* Draw fill */
-	clearlooks_rounded_rectangle (cr, 1, 0, width-2, height, widget->roundness, widget->corners);
 	murrine_set_color_rgba (cr, &fill, 0.4);
+	clearlooks_rounded_rectangle (cr, 1, 0, width-2, height, widget->roundness, widget->corners);
 	cairo_fill (cr);
 
 	/* Draw border */
-	murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners);
 	murrine_set_color_rgba (cr, border, 0.82);
+	murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners);
 	cairo_stroke (cr);
 }
 
@@ -1360,7 +1342,6 @@
 	cairo_restore (cr);
 
 	murrine_set_color_rgb (cr, &border_normal);
-	/* Draw the border */
 	murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners);
 	cairo_stroke (cr);
 }
@@ -1397,16 +1378,12 @@
 	}
 
 	/* Set colors */
-	MurrineRGB fill;
-	if (scrollbar->has_color)
-		fill = scrollbar->color;
-	else
-		fill = colors->bg[0];
-
+	MurrineRGB fill = scrollbar->has_color ? scrollbar->color : colors->bg[0];
 	MurrineRGB border;
-	murrine_shade (&colors->shade[7], 0.95, &border);
 	MurrineRGB highlight;
 
+	murrine_shade (&colors->shade[7], 0.95, &border);
+
 	if (widget->prelight)
 		murrine_shade (&fill, 1.06, &fill);
 
@@ -1427,8 +1404,8 @@
 	cairo_set_line_width (cr, 1.0);
 	cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
 
-	murrine_rounded_rectangle_fast (cr, 0.5, 0.5, width-1, height-1, widget->corners);
 	murrine_set_color_rgb (cr, &border);
+	murrine_rounded_rectangle_fast (cr, 0.5, 0.5, width-1, height-1, widget->corners);
 	cairo_stroke (cr);
 
 	cairo_rectangle (cr, 1, 1, width-2, height-2);
@@ -1624,9 +1601,9 @@
 
 	for (i=0; i<num_bars; i++)
 	{
+		murrine_set_color_rgb (cr, dark);
 		cairo_move_to (cr, 0, bar_y);
 		cairo_line_to (cr, bar_width, bar_y);
-		murrine_set_color_rgb (cr, dark);
 		cairo_stroke (cr);
 
 		bar_y += bar_spacing;
@@ -1728,16 +1705,15 @@
 			cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
 			cairo_set_line_width (cr, 2);
 
+			murrine_set_color_rgba (cr, dot, trans);
 			cairo_move_to(cr, 5, 7);
 			cairo_line_to(cr, 9, 7);
-
-			murrine_set_color_rgba (cr, dot, trans);
 			cairo_stroke (cr);
 		}
 		else
 		{
-			cairo_arc (cr, 7, 7, 3, 0, G_PI*2);
 			murrine_set_color_rgba (cr, dot, trans);
+			cairo_arc (cr, 7, 7, 3, 0, G_PI*2);
 			cairo_fill (cr);
 		}
 	}
@@ -1785,8 +1761,8 @@
 	{
 		if (widget->reliefstyle > 1)
 		{
-			cairo_rectangle (cr, 0.5, 0.5, width-1, height-1);
 			murrine_set_color_rgba (cr, &colors->shade[8], 0.12);
+			cairo_rectangle (cr, 0.5, 0.5, width-1, height-1);
 			cairo_stroke (cr);
 		}
 
@@ -1889,12 +1865,12 @@
 	cairo_paint (cr);
 	cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
 
-	clearlooks_rounded_rectangle (cr, 0, 0, width, height, widget->roundness > 1 ? widget->roundness+1 : 0, corners);
 	murrine_set_color_rgba (cr, &colors->bg[0], MENU_OPACITY);
+	clearlooks_rounded_rectangle (cr, 0, 0, width, height, widget->roundness > 1 ? widget->roundness+1 : 0, corners);
 	cairo_fill (cr);
 
-	murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, corners);
 	murrine_set_color_rgb (cr, border);
+	murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, corners);
 	cairo_stroke          (cr);
 
 	if (menustyle == 1)
@@ -1903,8 +1879,8 @@
 		MurrineRGB border2;
 		murrine_shade (fill, 0.5, &border2);
 
-		cairo_rectangle (cr, 0.5, 0.5, 3, height-1);
 		murrine_set_color_rgb (cr, &border2);
+		cairo_rectangle (cr, 0.5, 0.5, 3, height-1);
 		cairo_stroke_preserve (cr);
 
 		murrine_set_color_rgb (cr, fill);



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