[murrine/textstyle-changes] Chanoptionmenuges to textstyle, might not work well



commit 55aeb99490565b97451a444a4849e3141338ed21
Author: Andrea <andrea cimitan gmail com>
Date:   Sat May 8 21:14:09 2010 +0200

    Chanoptionmenuges to textstyle, might not work well

 src/murrine_style.c |   63 ++++++++++++++++++++++++++++++--------------------
 1 files changed, 38 insertions(+), 25 deletions(-)
---
diff --git a/src/murrine_style.c b/src/murrine_style.c
index 0830fb0..13fbe34 100644
--- a/src/murrine_style.c
+++ b/src/murrine_style.c
@@ -1942,7 +1942,8 @@ murrine_style_draw_layout (GtkStyle     *style,
 
 	if (widget && (state_type == GTK_STATE_INSENSITIVE || 
 	    (MURRINE_STYLE (style)->textstyle != 0 &&
-	     state_type != GTK_STATE_PRELIGHT)))
+	     state_type != GTK_STATE_PRELIGHT &&
+	     !(DETAIL ("cellrenderertext") && state_type== GTK_STATE_NORMAL))))
 	{
 		MurrineStyle *murrine_style = MURRINE_STYLE (style);
 		MurrineColors *colors = &murrine_style->colors;
@@ -1982,22 +1983,41 @@ murrine_style_draw_layout (GtkStyle     *style,
 			yos = 1;
 		}
 
-		GtkReliefStyle relief = GTK_RELIEF_NORMAL;
-		/* Check for the shadow type. */
-		if (widget->parent && MRN_IS_BUTTON (widget->parent))
-			g_object_get (G_OBJECT (widget->parent), "relief", &relief, NULL);
-
-		if (!gtk_widget_get_has_window (widget) && (widget->parent &&
-		    (!MRN_IS_BUTTON(widget->parent) &&
-                     !MRN_IS_COMBO_BOX(widget->parent) &&
-                     !MRN_IS_COMBO_BOX_ENTRY(widget->parent) &&
-                     !MRN_IS_COMBO(widget->parent) &&
-                     !MRN_IS_OPTION_MENU(widget->parent) &&
-                     !MRN_IS_NOTEBOOK(widget->parent)) ||
-                      MRN_IS_CHECK_BUTTON(widget->parent) ||
-                      MRN_IS_RADIO_BUTTON(widget->parent) ||
-                      (relief == GTK_RELIEF_NONE && state_type == GTK_STATE_NORMAL)))
-			murrine_shade (&params.parentbg, shade_level, &temp);
+		if (!gtk_widget_get_has_window (widget))
+		{
+			boolean use_parentbg = TRUE;
+			while (widget->parent)
+			{
+				if (MRN_IS_BUTTON(widget->parent) ||
+				    MRN_IS_TOGGLE_BUTTON(widget->parent) ||
+				    MRN_IS_COMBO_BOX(widget->parent) ||
+				    MRN_IS_COMBO_BOX_ENTRY(widget->parent) ||
+				    MRN_IS_COMBO(widget->parent) ||
+				    MRN_IS_OPTION_MENU(widget->parent) ||
+				    MRN_IS_NOTEBOOK(widget->parent))
+				{
+					GtkReliefStyle relief = GTK_RELIEF_NORMAL;
+					/* Check for the shadow type. */
+					if (MRN_IS_BUTTON (widget->parent))
+						g_object_get (G_OBJECT (widget->parent), "relief", &relief, NULL);
+
+					if (!MRN_IS_CHECK_BUTTON(widget->parent) &&
+					    !MRN_IS_RADIO_BUTTON(widget->parent) &&
+					    !(relief == GTK_RELIEF_NONE && state_type == GTK_STATE_NORMAL))
+						use_parentbg = FALSE;
+
+					break;
+				}
+				widget = widget->parent;
+			}
+
+			if (use_parentbg)
+				murrine_shade (&params.parentbg, shade_level, &temp);
+			else if (DETAIL ("cellrenderertext"))
+				murrine_shade (&colors->base[state_type], shade_level, &temp);
+			else
+				murrine_shade (&colors->bg[state_type], shade_level, &temp);
+		}
 		else if (DETAIL ("cellrenderertext"))
 			murrine_shade (&colors->base[state_type], shade_level, &temp);
 		else
@@ -2007,16 +2027,9 @@ murrine_style_draw_layout (GtkStyle     *style,
 		etched.green = (int) (temp.g*65535);
 		etched.blue = (int) (temp.b*65535);
 
-/*		cairo_t *cr;*/
-/*		cr = murrine_begin_paint (window, area);*/
-/*		cairo_translate (cr, x+xos, y+yos);*/
-/*		murrine_set_color_rgb (cr, &temp);*/
-/*		pango_cairo_show_layout (cr, layout);*/
-/*		cairo_destroy (cr);*/
-		
 		gdk_draw_layout_with_colors (window, gc, x+xos, y+yos, layout, &etched, NULL);
 
-		//printf( "draw_layout: %s %s\n", detail, G_OBJECT_TYPE_NAME (widget->parent));
+/*		printf( "draw_layout: %s %s\n", detail, G_OBJECT_TYPE_NAME (widget->parent));*/
 	}
 
 	if (DETAIL ("accellabel"))



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