murrine r39 - trunk/src



Author: acimitan
Date: Sun Aug 24 00:53:40 2008
New Revision: 39
URL: http://svn.gnome.org/viewvc/murrine?rev=39&view=rev

Log:
quick test with  a different tab style, does not work with RGBA, TESTING

Modified:
   trunk/src/murrine_draw.c
   trunk/src/murrine_style.c

Modified: trunk/src/murrine_draw.c
==============================================================================
--- trunk/src/murrine_draw.c	(original)
+++ trunk/src/murrine_draw.c	Sun Aug 24 00:53:40 2008
@@ -992,7 +992,7 @@
 	if (!widget->active)
 		border1 = (MurrineRGB*)&colors->shade[5];
 	else
-		border1 = (MurrineRGB*)&colors->shade[4];
+		border1 = (MurrineRGB*)&colors->shade[3];
 
 	/* Set clip */
 	cairo_rectangle (cr, x, y, width, height);
@@ -1114,6 +1114,22 @@
 	}
 	else
 	{
+		MurrineRGB shade1, shade2, shade3, shade4;
+
+		MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
+		mrn_gradient_custom.gradient_shades[0] = get_decreased_ratio (widget->mrn_gradient.gradient_shades[0], 2.0);
+		mrn_gradient_custom.gradient_shades[1] = get_decreased_ratio (widget->mrn_gradient.gradient_shades[1], 2.0);
+		mrn_gradient_custom.gradient_shades[2] = get_decreased_ratio (widget->mrn_gradient.gradient_shades[2], 2.0);
+		mrn_gradient_custom.gradient_shades[3] = get_decreased_ratio (widget->mrn_gradient.gradient_shades[3], 2.0);
+
+		double custom_highlight_ratio = widget->highlight_ratio;
+		custom_highlight_ratio = get_decreased_ratio (widget->highlight_ratio, 2.0);
+
+		murrine_shade (fill, mrn_gradient_custom.gradient_shades[0]*custom_highlight_ratio, &shade1);
+		murrine_shade (fill, mrn_gradient_custom.gradient_shades[1]*custom_highlight_ratio, &shade2);
+		murrine_shade (fill, mrn_gradient_custom.gradient_shades[2], &shade3);
+		murrine_shade (fill, 1.0, &shade4);
+
 		/* Draw shade */
 		switch (tab->gap_side)
 		{
@@ -1136,12 +1152,23 @@
 		else
 			clearlooks_rounded_rectangle (cr, 0, 0, width-1, height-1, widget->roundness, corners);
 
-		cairo_pattern_add_color_stop_rgb (pattern, 0.0,         stripe_fill->r, stripe_fill->g, stripe_fill->b);
-		cairo_pattern_add_color_stop_rgb (pattern, strip_size,  stripe_fill->r, stripe_fill->g, stripe_fill->b);
-		cairo_pattern_add_color_stop_rgba (pattern, strip_size, fill->r, fill->g, fill->b, 0.0);
+		cairo_pattern_add_color_stop_rgb (pattern, 0.0, shade1.r, shade1.g, shade1.b);
+		cairo_pattern_add_color_stop_rgb (pattern, 0.45, shade2.r, shade2.g, shade2.b);
+		cairo_pattern_add_color_stop_rgb (pattern, 0.45, shade3.r, shade3.g, shade3.b);
+		cairo_pattern_add_color_stop_rgb (pattern, 1.0, shade4.r, shade4.g, shade4.b);
 		cairo_set_source (cr, pattern);
 		cairo_fill (cr);
 		cairo_pattern_destroy (pattern);
+
+		cairo_set_line_width (cr, 1.0);
+		murrine_set_color_rgba (cr, &colors->shade[0], 0.4);
+
+		if (widget->roundness < 2)
+			cairo_rectangle (cr, 1, 1, width-3, height-3);
+		else
+			clearlooks_rounded_rectangle (cr, 1, 1, width-3, height-3, widget->roundness, corners);
+
+		cairo_stroke (cr);
 	}
 
 	murrine_rounded_rectangle (cr, 0, 0, width-1, height-1, widget->roundness, corners);
@@ -1169,9 +1196,9 @@
 				break;
 		}
 
-		cairo_pattern_add_color_stop_rgb (pattern, 0.0,        stripe_border->r, stripe_border->g, stripe_border->b);
-		cairo_pattern_add_color_stop_rgb (pattern, strip_size, stripe_border->r, stripe_border->g, stripe_border->b);
-		cairo_pattern_add_color_stop_rgb (pattern, strip_size, stripe_border->r, stripe_border->g, stripe_border->b);
+		cairo_pattern_add_color_stop_rgb (pattern, 0.0,        border1->r,       border1->g,       border1->b);
+		cairo_pattern_add_color_stop_rgb (pattern, strip_size, border1->r,       border1->g,       border1->b);
+		cairo_pattern_add_color_stop_rgb (pattern, strip_size, border1->r,       border1->g,       border1->b);
 		cairo_pattern_add_color_stop_rgb (pattern, 0.8,        border1->r,       border1->g,       border1->b);
 		cairo_set_source (cr, pattern);
 		cairo_stroke (cr);

Modified: trunk/src/murrine_style.c
==============================================================================
--- trunk/src/murrine_style.c	(original)
+++ trunk/src/murrine_style.c	Sun Aug 24 00:53:40 2008
@@ -1001,6 +1001,10 @@
 		else
 			params.corners = MRN_CORNER_NONE;
 
+		/* Use reliefstyle to remove inset on disabled slider button */
+		if (params.disabled)
+			params.reliefstyle = 0;
+
 		STYLE_FUNCTION(draw_button) (cr, &murrine_style->colors, &params, x, y, width, height, horizontal);
 
 		if (murrine_style->sliderstyle == 1)



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