[murrine] Added textstyle = 1 for a bright inset at the bottom, applied on the text



commit dcd195b0f0a52610f62b702165ddbfb2a2ca7bcd
Author: Andrea Cimitan <andrea cimitan gmail com>
Date:   Fri Dec 4 12:13:16 2009 +0100

    Added textstyle = 1 for a bright inset at the bottom, applied on the text

 src/murrine_rc_style.c |    9 +++++++++
 src/murrine_rc_style.h |    4 +++-
 src/murrine_style.c    |   27 ++++++++++++++++++++++++++-
 src/murrine_style.h    |    1 +
 4 files changed, 39 insertions(+), 2 deletions(-)
---
diff --git a/src/murrine_rc_style.c b/src/murrine_rc_style.c
index 02415dc..975a39a 100644
--- a/src/murrine_rc_style.c
+++ b/src/murrine_rc_style.c
@@ -64,6 +64,7 @@ enum
 	TOKEN_SCROLLBARSTYLE,
 	TOKEN_SLIDERSTYLE,
 	TOKEN_STEPPERSTYLE,
+	TOKEN_TEXTSTYLE,
 	TOKEN_TOOLBARSTYLE,
 
 	TOKEN_CANDIDO,
@@ -119,6 +120,7 @@ theme_symbols[] =
 	{ "scrollbarstyle",      TOKEN_SCROLLBARSTYLE },
 	{ "sliderstyle",         TOKEN_SLIDERSTYLE },
 	{ "stepperstyle",        TOKEN_STEPPERSTYLE },
+	{ "textstyle",           TOKEN_TEXTSTYLE },
 	{ "toolbarstyle",        TOKEN_TOOLBARSTYLE },
 
 	{ "CANDIDO",             TOKEN_CANDIDO },
@@ -184,6 +186,7 @@ murrine_rc_style_init (MurrineRcStyle *murrine_rc)
 	murrine_rc->sliderstyle = 0;
 	murrine_rc->stepperstyle = 0;
 	murrine_rc->profile = MRN_PROFILE_MURRINE;
+	murrine_rc->textstyle = 0;
 	murrine_rc->toolbarstyle = 0;
 }
 
@@ -632,6 +635,10 @@ murrine_rc_style_parse (GtkRcStyle *rc_style,
 				token = theme_parse_int (settings, scanner, &murrine_style->stepperstyle);
 				murrine_style->flags |= MRN_FLAG_STEPPERSTYLE;
 				break;
+			case TOKEN_TEXTSTYLE:
+				token = theme_parse_int (settings, scanner, &murrine_style->textstyle);
+				murrine_style->flags |= MRN_FLAG_TEXTSTYLE;
+				break;
 			case TOKEN_TOOLBARSTYLE:
 				token = theme_parse_int (settings, scanner, &murrine_style->toolbarstyle);
 				murrine_style->flags |= MRN_FLAG_TOOLBARSTYLE;
@@ -770,6 +777,8 @@ murrine_rc_style_merge (GtkRcStyle *dest,
 		dest_w->sliderstyle = src_w->sliderstyle;
 	if (flags & MRN_FLAG_STEPPERSTYLE)
 		dest_w->stepperstyle = src_w->stepperstyle;
+	if (flags & MRN_FLAG_TEXTSTYLE)
+		dest_w->textstyle = src_w->textstyle;
 	if (flags & MRN_FLAG_TOOLBARSTYLE)
 		dest_w->toolbarstyle = src_w->toolbarstyle;
 
diff --git a/src/murrine_rc_style.h b/src/murrine_rc_style.h
index bf19573..7b11e72 100644
--- a/src/murrine_rc_style.h
+++ b/src/murrine_rc_style.h
@@ -64,7 +64,8 @@ typedef enum
 	MRN_FLAG_SCROLLBARSTYLE = 1 << 26,
 	MRN_FLAG_SLIDERSTYLE = 1 << 27,
 	MRN_FLAG_STEPPERSTYLE = 1 << 28,
-	MRN_FLAG_TOOLBARSTYLE = 1 << 29
+	MRN_FLAG_TEXTSTYLE = 1 << 29,
+	MRN_FLAG_TOOLBARSTYLE = 1 << 30
 } MurrineRcFlags;
 
 struct _MurrineRcStyle
@@ -96,6 +97,7 @@ struct _MurrineRcStyle
 	guint8   scrollbarstyle;
 	guint8   sliderstyle;
 	guint8   stepperstyle;
+	guint8   textstyle;
 	guint8   toolbarstyle;
 
 	gboolean animation;
diff --git a/src/murrine_style.c b/src/murrine_style.c
index 402418d..fc31203 100644
--- a/src/murrine_style.c
+++ b/src/murrine_style.c
@@ -1845,8 +1845,31 @@ murrine_style_draw_layout (GtkStyle     *style,
 		gdk_draw_layout_with_colors (window, gc, x+1, y+1, layout, &etched, NULL);
 		gdk_draw_layout (window, gc, x, y, layout);
 	}
-	else
+	else 
 	{
+		MurrineStyle *murrine_style = MURRINE_STYLE (style);
+		MurrineColors *colors = &murrine_style->colors;
+
+		if (murrine_style->textstyle != 0 && widget->state == GTK_STATE_NORMAL)
+		{
+			WidgetParameters params;
+
+			murrine_set_widget_parameters (widget, style, state_type, &params);
+
+			GdkColor etched;
+			MurrineRGB temp;
+
+			if (GTK_WIDGET_NO_WINDOW (widget))
+				murrine_shade (&params.parentbg, 1.05, &temp);
+			else
+				murrine_shade (&colors->bg[widget->state], 1.05, &temp);
+
+			etched.red = (int) (temp.r*65535);
+			etched.green = (int) (temp.g*65535);
+			etched.blue = (int) (temp.b*65535);
+
+			gdk_draw_layout_with_colors (window, gc, x, y+1, layout, &etched, NULL);
+		}
 		gdk_draw_layout (window, gc, x, y, layout);
 	}
 
@@ -2161,6 +2184,7 @@ murrine_style_init_from_rc (GtkStyle   *style,
 	murrine_style->scrollbarstyle      = MURRINE_RC_STYLE (rc_style)->scrollbarstyle;
 	murrine_style->sliderstyle         = MURRINE_RC_STYLE (rc_style)->sliderstyle;
 	murrine_style->stepperstyle        = MURRINE_RC_STYLE (rc_style)->stepperstyle;
+	murrine_style->textstyle           = MURRINE_RC_STYLE (rc_style)->textstyle;	
 	murrine_style->toolbarstyle        = MURRINE_RC_STYLE (rc_style)->toolbarstyle;
 
 	if (murrine_style->has_focus_color)
@@ -2350,6 +2374,7 @@ murrine_style_copy (GtkStyle *style, GtkStyle *src)
 	mrn_style->scrollbarstyle      = mrn_src->scrollbarstyle;
 	mrn_style->sliderstyle 	       = mrn_src->sliderstyle;
 	mrn_style->stepperstyle        = mrn_src->stepperstyle;
+	mrn_style->textstyle           = mrn_src->textstyle;
 	mrn_style->toolbarstyle        = mrn_src->toolbarstyle;
 
 	GTK_STYLE_CLASS (murrine_style_parent_class)->copy (style, src);
diff --git a/src/murrine_style.h b/src/murrine_style.h
index 60652fc..70d8d08 100644
--- a/src/murrine_style.h
+++ b/src/murrine_style.h
@@ -67,6 +67,7 @@ struct _MurrineStyle
 	guint8   scrollbarstyle;
 	guint8   sliderstyle;
 	guint8   stepperstyle;
+	guint8   textstyle;
 	guint8   toolbarstyle;
 
 	gboolean animation;



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