murrine r131 - in trunk: . src



Author: acimitan
Date: Sun Jan 11 10:29:38 2009
New Revision: 131
URL: http://svn.gnome.org/viewvc/murrine?rev=131&view=rev

Log:
2009-01-11  Andrea Cimitan  <andrea cimitan gmail com>

	* src/murrine_draw.c (murrine_draw_button), (murrine_draw_tab),
	(murrine_draw_radiobutton), (murrine_draw_checkbox):
	* src/murrine_draw_rgba.c (murrine_rgba_draw_button),
	(murrine_rgba_draw_tab), (murrine_rgba_draw_radiobutton),
	(murrine_rgba_draw_checkbox):
	Automatically reduce lightborder_shade for widgets in disabled state:
	button, radio and check, tab.
	Fixed reliefstyle = 0 in radio and check.
	Feedback is always welcome, if you prefer before the lightborder_shade
	tweak.


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	Sun Jan 11 10:29:38 2009
@@ -150,6 +150,7 @@
 	double xos = widget->xthickness > 2 ? 1 : 0;
 	double yos = widget->ythickness > 2 ? 1 : 0;
 	double highlight_shade_custom = widget->highlight_shade;
+	double lightborder_shade_custom = widget->lightborder_shade;
 	MurrineRGB fill = colors->bg[widget->state_type];
 	MurrineRGB border = colors->shade[!widget->disabled ? 6 : 5];
 	MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
@@ -158,6 +159,7 @@
 	{
 		mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
 		highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
+		lightborder_shade_custom = get_decreased_shade (widget->lightborder_shade, 2.0);
 	}
 	else
 		murrine_shade (&colors->shade[6], 0.95, &border);
@@ -193,7 +195,7 @@
 	cairo_clip_preserve (cr);
 
 	murrine_draw_glaze (cr, &fill,
-	                    widget->glow_shade, highlight_shade_custom, !widget->active ? widget->lightborder_shade : 1.0,
+	                    widget->glow_shade, highlight_shade_custom, !widget->active ? lightborder_shade_custom : 1.0,
 	                    mrn_gradient_custom, widget,
 	                    xos+1, yos+1, width-(xos*2)-2, height-(yos*2)-2,
 	                    widget->roundness, widget->corners, horizontal);
@@ -982,6 +984,7 @@
 		MurrineRGB shade1, shade2, shade3, shade4, highlight;
 		MurrineGradients mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
 		double highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
+		double lightborder_shade_custom = get_decreased_shade (widget->lightborder_shade, 2.0);
 
 		murrine_shade (fill, mrn_gradient_custom.gradient_shades[0]*highlight_shade_custom, &shade1);
 		murrine_shade (fill, mrn_gradient_custom.gradient_shades[1]*highlight_shade_custom, &shade2);
@@ -1015,7 +1018,7 @@
 		cairo_pattern_destroy (pat);
 
 		/* Draw lightborder */
-		murrine_shade (fill, widget->lightborder_shade*highlight_shade_custom, &highlight);
+		murrine_shade (fill, lightborder_shade_custom*highlight_shade_custom, &highlight);
 		murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[0]*highlight_shade_custom, &shade1);
 		murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[1]*highlight_shade_custom, &shade2);
 		murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[2], &shade3);
@@ -1844,6 +1847,7 @@
 	gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
 	int roundness = 5;
 	double highlight_shade_custom = widget->highlight_shade;
+	double lightborder_shade_custom = widget->lightborder_shade;
 	MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
 
 	inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
@@ -1859,6 +1863,7 @@
 
 		mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
 		highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
+		lightborder_shade_custom = get_decreased_shade (widget->lightborder_shade, 2.0);
 	}
 	else
 	{
@@ -1884,7 +1889,7 @@
 			murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, roundness+1, widget->corners);
 			cairo_stroke (cr);
 		}
-		else
+		else if (widget->reliefstyle != 0)
 			murrine_draw_inset (cr, &widget->parentbg, 0.5, 0.5, width-1, height-1, roundness+1, widget->corners);
 	}
 
@@ -1896,7 +1901,7 @@
 	if (draw_bullet)
 	{
 		murrine_draw_glaze (cr, bg,
-		                    widget->glow_shade, highlight_shade_custom, widget->lightborder_shade,
+		                    widget->glow_shade, highlight_shade_custom, lightborder_shade_custom,
 		                    mrn_gradient_custom, widget, 2, 2, width-4, height-4,
 		                    roundness, widget->corners, TRUE);
 	}
@@ -1950,6 +1955,7 @@
 	gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
 	int roundness = CLAMP (widget->roundness, 0, 2);
 	double highlight_shade_custom = widget->highlight_shade;
+	double lightborder_shade_custom = widget->lightborder_shade;
 	MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
 
 	inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
@@ -1965,6 +1971,7 @@
 
 		mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
 		highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
+		lightborder_shade_custom = get_decreased_shade (widget->lightborder_shade, 2.0);
 	}
 	else
 	{
@@ -1990,7 +1997,7 @@
 			murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, roundness+1, widget->corners);
 			cairo_stroke (cr);
 		}
-		else
+		else if (widget->reliefstyle != 0)
 			murrine_draw_inset (cr, &widget->parentbg, 0.5, 0.5, width-1, height-1, roundness+1, widget->corners);
 	}
 
@@ -2002,7 +2009,7 @@
 	if (draw_bullet)
 	{
 		murrine_draw_glaze (cr, bg,
-		                    widget->glow_shade, highlight_shade_custom, widget->lightborder_shade,
+		                    widget->glow_shade, highlight_shade_custom, lightborder_shade_custom,
 		                    mrn_gradient_custom, widget, 2, 2, width-4, height-4,
 		                    roundness, widget->corners, TRUE);
 	}

Modified: trunk/src/murrine_draw_rgba.c
==============================================================================
--- trunk/src/murrine_draw_rgba.c	(original)
+++ trunk/src/murrine_draw_rgba.c	Sun Jan 11 10:29:38 2009
@@ -148,6 +148,7 @@
 	double xos = widget->xthickness > 2 ? 1 : 0;
 	double yos = widget->ythickness > 2 ? 1 : 0;
 	double highlight_shade_custom = widget->highlight_shade;
+	double lightborder_shade_custom = widget->lightborder_shade;
 	MurrineRGB fill = colors->bg[widget->state_type];
 	MurrineRGB border = colors->shade[!widget->disabled ? 8 : 6];
 	MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
@@ -156,6 +157,7 @@
 	{
 		mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
 		highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
+		lightborder_shade_custom = get_decreased_shade (widget->lightborder_shade, 2.0);
 	}
 	else
 		murrine_shade (&colors->shade[8], 0.95, &border);
@@ -194,7 +196,7 @@
 	cairo_clip_preserve (cr);
 
 	murrine_draw_glaze (cr, &fill,
-	                    widget->glow_shade, highlight_shade_custom, !widget->active ? widget->lightborder_shade : 1.0,
+	                    widget->glow_shade, highlight_shade_custom, !widget->active ? lightborder_shade_custom : 1.0,
 	                    mrn_gradient_custom, widget, xos+1, yos+1, width-(xos*2)-2, height-(yos*2)-2,
 	                    widget->roundness, widget->corners, horizontal);
 
@@ -985,6 +987,7 @@
 		MurrineRGB shade1, shade2, shade3, shade4, highlight;
 		MurrineGradients mrn_gradient_custom = mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
 		double highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
+		double lightborder_shade_custom = get_decreased_shade (widget->lightborder_shade, 2.0);
 
 		murrine_shade (fill, mrn_gradient_custom.gradient_shades[0]*highlight_shade_custom, &shade1);
 		murrine_shade (fill, mrn_gradient_custom.gradient_shades[1]*highlight_shade_custom, &shade2);
@@ -1020,7 +1023,7 @@
 		/* Draw lightborder */
 		cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
 
-		murrine_shade (fill, widget->lightborder_shade*highlight_shade_custom, &highlight);
+		murrine_shade (fill, lightborder_shade_custom*highlight_shade_custom, &highlight);
 		murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[0]*highlight_shade_custom, &shade1);
 		murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[1]*highlight_shade_custom, &shade2);
 		murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[2], &shade3);
@@ -1453,6 +1456,7 @@
 	gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
 	int roundness = 5;
 	double highlight_shade_custom = widget->highlight_shade;
+	double lightborder_shade_custom = widget->lightborder_shade;
 	MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
 
 	inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
@@ -1468,6 +1472,7 @@
 
 		mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
 		highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
+		lightborder_shade_custom = get_decreased_shade (widget->lightborder_shade, 2.0);
 	}
 	else
 	{
@@ -1495,7 +1500,7 @@
 			murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, roundness+1, widget->corners);
 			cairo_stroke (cr);
 		}
-		else
+		else if (widget->reliefstyle != 0)
 			murrine_draw_inset (cr, &widget->parentbg, 0.5, 0.5, width-1, height-1, roundness+1, widget->corners);
 	}
 
@@ -1507,7 +1512,7 @@
 	if (draw_bullet)
 	{
 		murrine_draw_glaze (cr, bg,
-		                    widget->glow_shade, highlight_shade_custom, widget->lightborder_shade,
+		                    widget->glow_shade, highlight_shade_custom, lightborder_shade_custom,
 		                    mrn_gradient_custom, widget, 2, 2, width-4, height-4,
 		                    roundness, widget->corners, TRUE);
 	}
@@ -1561,6 +1566,7 @@
 	gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
 	int roundness = CLAMP (widget->roundness, 0, 2);
 	double highlight_shade_custom = widget->highlight_shade;
+	double lightborder_shade_custom = widget->lightborder_shade;
 	MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
 
 	inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
@@ -1576,6 +1582,7 @@
 
 		mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
 		highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
+		lightborder_shade_custom = get_decreased_shade (widget->lightborder_shade, 2.0);
 	}
 	else
 	{
@@ -1603,7 +1610,7 @@
 			murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, roundness+1, widget->corners);
 			cairo_stroke (cr);
 		}
-		else
+		else if (widget->reliefstyle != 0)
 			murrine_draw_inset (cr, &widget->parentbg, 0.5, 0.5, width-1, height-1, roundness+1, widget->corners);
 	}
 
@@ -1615,7 +1622,7 @@
 	if (draw_bullet)
 	{
 		murrine_draw_glaze (cr, bg,
-		                    widget->glow_shade, highlight_shade_custom, widget->lightborder_shade,
+		                    widget->glow_shade, highlight_shade_custom, lightborder_shade_custom,
 		                    mrn_gradient_custom, widget, 2, 2, width-4, height-4,
 		                    roundness, widget->corners, TRUE);
 	}



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