murrine r72 - in trunk: . src



Author: acimitan
Date: Fri Sep 26 22:24:07 2008
New Revision: 72
URL: http://svn.gnome.org/viewvc/murrine?rev=72&view=rev

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

	* src/murrine_draw.c (murrine_draw_entry),
	(murrine_draw_progressbar_trough):
	* src/murrine_draw_rgba.c (murrine_rgba_draw_entry),
	(murrine_rgba_draw_progressbar_trough):
	* src/murrine_style.c (murrine_style_draw_shadow),
	(murrine_style_draw_box):
	Add support for the "transparent-bg-hint" for entries and progressbars.



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

Modified: trunk/src/murrine_draw.c
==============================================================================
--- trunk/src/murrine_draw.c	(original)
+++ trunk/src/murrine_draw.c	Fri Sep 26 22:24:07 2008
@@ -327,12 +327,7 @@
 	cairo_translate (cr, x+0.5, y+0.5);
 	cairo_set_line_width (cr, 1.0);
 
-	/* Fill the background (shouldn't have to) */
-	cairo_rectangle (cr, -0.5, -0.5, width, height);
-	murrine_set_color_rgb (cr, &widget->parentbg);
-	cairo_fill (cr);
-
-	/* Fill the entry's base color (why isn't is large enough by default?) */
+	/* Fill the entry's base color */
 	cairo_rectangle (cr, 1.5, 1.5, width-4, height-4);
 	murrine_set_color_rgb (cr, base);
 	cairo_fill (cr);
@@ -527,11 +522,6 @@
 
 	cairo_set_line_width (cr, 1.0);
 
-	/* Fill with bg color */
-	cairo_rectangle (cr, x, y, width, height);
-	murrine_set_color_rgb (cr, &colors->bg[widget->state_type]);
-	cairo_fill (cr);
-
 	/* Create trough box */
 	cairo_rectangle (cr, x+1, y+1, width-2, height-2);
 	murrine_set_color_rgba (cr, &fill, 0.44);

Modified: trunk/src/murrine_draw_rgba.c
==============================================================================
--- trunk/src/murrine_draw_rgba.c	(original)
+++ trunk/src/murrine_draw_rgba.c	Fri Sep 26 22:24:07 2008
@@ -342,13 +342,8 @@
 	*/
 	cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
 
-	/* Fill the background (shouldn't have to) */
-	cairo_rectangle (cr, -0.5, -0.5, width, height);
-	murrine_set_color_rgba (cr, &widget->parentbg, WINDOW_OPACITY);
-	cairo_fill (cr);
-
 	/* Fill the entry's base color (why isn't is large enough by default?) */
-	cairo_rectangle (cr, 1.5, 1.5, width-3, height-3);
+	cairo_rectangle (cr, 1.5, 1.5, width-4, height-4);
 	murrine_set_color_rgba (cr, base, ENTRY_OPACITY);
 	cairo_fill (cr);
 
@@ -487,14 +482,6 @@
 	murrine_shade (&widget->parentbg, 0.95, &fill);
 
 	cairo_set_line_width (cr, 1.0);
-	cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
-
-	/* Fill with bg color */
-	cairo_rectangle (cr, x, y, width, height);
-	murrine_set_color_rgba (cr, &colors->bg[widget->state_type], WINDOW_OPACITY);
-	cairo_fill (cr);
-
-	cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
 
 	/* Create trough box */
 	cairo_rectangle (cr, x+1, y+1, width-2, height-2);

Modified: trunk/src/murrine_style.c
==============================================================================
--- trunk/src/murrine_style.c	(original)
+++ trunk/src/murrine_style.c	Fri Sep 26 22:24:07 2008
@@ -389,6 +389,25 @@
 				params.corners = MRN_CORNER_TOPRIGHT | MRN_CORNER_BOTTOMRIGHT;
 		}
 
+		/* Fill the background as it is initilized to base[NORMAL].
+		 * Relevant GTK+ bug: http://bugzilla.gnome.org/show_bug.cgi?id=513471
+		 * The fill only happens if no hint has been added by some application
+		 * that is faking GTK+ widgets. */
+		if (widget && !g_object_get_data(G_OBJECT (widget), "transparent-bg-hint"))
+		{
+			cairo_rectangle (cr, 0, 0, width, height);
+			if (!params.mrn_gradient.use_rgba)
+				murrine_set_color_rgb (cr, &params.parentbg);
+			else
+			{
+				cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
+				cairo_paint(cr);
+				cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
+				murrine_set_color_rgba (cr, &params.parentbg, WINDOW_OPACITY);
+			}
+			cairo_fill (cr);
+		}
+
 		STYLE_FUNCTION(draw_entry) (cr, &murrine_style->colors, &params,
 		                    x, y, width, height);
 	}
@@ -913,6 +932,25 @@
 
 		murrine_set_widget_parameters (widget, style, state_type, &params);
 
+		/* Fill the background as it is initilized to base[NORMAL].
+		 * Relevant GTK+ bug: http://bugzilla.gnome.org/show_bug.cgi?id=513471
+		 * The fill only happens if no hint has been added by some application
+		 * that is faking GTK+ widgets. */
+		if (widget && !g_object_get_data(G_OBJECT (widget), "transparent-bg-hint"))
+		{
+			cairo_rectangle (cr, 0, 0, width, height);
+			if (!params.mrn_gradient.use_rgba)
+				murrine_set_color_rgb (cr, &params.parentbg);
+			else
+			{
+				cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
+				cairo_paint(cr);
+				cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
+				murrine_set_color_rgba (cr, &params.parentbg, WINDOW_OPACITY);
+			}
+			cairo_fill (cr);
+		}
+
 		STYLE_FUNCTION(draw_progressbar_trough) (cr, colors, &params, x, y, width, height);
 	}
 	else if (DETAIL ("trough") && widget && (MRN_IS_VSCROLLBAR (widget) || MRN_IS_HSCROLLBAR (widget)))



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