murrine r19 - in trunk: . src



Author: acimitan
Date: Wed Feb 27 12:55:13 2008
New Revision: 19
URL: http://svn.gnome.org/viewvc/murrine?rev=19&view=rev

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

	* src/murrine_draw.c: (murrine_draw_button), (murrine_draw_entry),
	(murrine_draw_scale_trough), (murrine_draw_radiobutton),
	(murrine_draw_checkbox):
	* src/murrine_draw_rgba.c: (murrine_rgba_draw_button),
	(murrine_rgba_draw_entry), (murrine_rgba_draw_scale_trough),
	(murrine_rgba_draw_radiobutton), (murrine_rgba_draw_checkbox):
	* src/murrine_rc_style.c: (murrine_rc_style_init),
	(murrine_rc_style_parse), (murrine_rc_style_merge):
	* src/murrine_rc_style.h:
	* src/murrine_style.c: (murrine_set_widget_parameters),
	(murrine_style_init_from_rc), (murrine_style_copy):
	* src/murrine_style.h:
	* src/murrine_types.h:
	Added reliefstyle, 2 means shadow, 1 inset, 0 flat
	Need to be added also on draw_frame


Modified:
   trunk/ChangeLog
   trunk/src/murrine_draw.c
   trunk/src/murrine_draw_rgba.c
   trunk/src/murrine_rc_style.c
   trunk/src/murrine_rc_style.h
   trunk/src/murrine_style.c
   trunk/src/murrine_style.h
   trunk/src/murrine_types.h

Modified: trunk/src/murrine_draw.c
==============================================================================
--- trunk/src/murrine_draw.c	(original)
+++ trunk/src/murrine_draw.c	Wed Feb 27 12:55:13 2008
@@ -184,13 +184,13 @@
 		yoffset = 1;
 
 	/* Start drawing the inset/shadow */
-	if (!widget->active && !widget->disabled)
+	if (!widget->active && !widget->disabled && widget->reliefstyle > 1)
 	{
 		murrine_rounded_rectangle (cr, xoffset, yoffset, width-(xoffset*2), height-(yoffset*2), widget->roundness, widget->corners);
 		murrine_set_color_rgba (cr, widget->disabled ? &border_disabled : &border_normal, 0.18);
 		cairo_stroke (cr);
 	}
-	else
+	else if (widget->reliefstyle != 0)
 		murrine_draw_inset (cr, &widget->parentbg, 0.5, 0.5, width-1, height-1, widget->roundness+1, widget->corners);
 
 	murrine_mix_color (widget->disabled ? &border_disabled : &border_normal , &fill, 0.4,
@@ -346,7 +346,8 @@
 	murrine_set_color_rgb (cr, base);
 	cairo_fill (cr);
 
-	murrine_draw_inset (cr, &widget->parentbg, 0, 0, width-1, height-1, radius+1, widget->corners);
+	if (widget->reliefstyle != 0)
+		murrine_draw_inset (cr, &widget->parentbg, 0, 0, width-1, height-1, radius+1, widget->corners);
 
 	/* Draw the focused border */
 	if (widget->focus)
@@ -468,7 +469,8 @@
 	cairo_set_line_width (cr, 1.0);
 	cairo_translate (cr, translate_x, translate_y);
 
-	murrine_draw_inset (cr, &widget->parentbg, 0, 0, trough_width+2, trough_height+2, 0, 0);
+	if (widget->reliefstyle != 0)
+		murrine_draw_inset (cr, &widget->parentbg, 0, 0, trough_width+2, trough_height+2, 0, 0);
 
 	cairo_translate (cr, 1, 1);
 
@@ -2141,10 +2143,13 @@
 
 	cairo_translate (cr, x, y);
 
-	cairo_set_line_width (cr, 2);
-	cairo_arc (cr, 7, 7, 6, 0, M_PI*2);
-	murrine_set_color_rgba (cr, &shadow, 0.15);
-	cairo_stroke (cr);
+	if (widget->reliefstyle > 1)
+	{
+		cairo_set_line_width (cr, 2.0);
+		cairo_arc (cr, 7, 7, 6, 0, M_PI*2);
+		murrine_set_color_rgba (cr, &shadow, 0.15);
+		cairo_stroke (cr);
+	}
 
 	cairo_set_line_width (cr, 1.0);
 
@@ -2235,9 +2240,12 @@
 
 	if (widget->xthickness > 2 && widget->ythickness > 2)
 	{
-		cairo_rectangle (cr, 0.5, 0.5, width-1, height-1);
-		murrine_set_color_rgba (cr, &shadow, 0.15);
-		cairo_stroke (cr);
+		if (widget->reliefstyle > 1)
+		{
+			cairo_rectangle (cr, 0.5, 0.5, width-1, height-1);
+			murrine_set_color_rgba (cr, &shadow, 0.15);
+			cairo_stroke (cr);
+		}
 
 		/* Draw the rectangle for the checkbox itself */
 		cairo_rectangle (cr, 1.5, 1.5, width-3, height-3);

Modified: trunk/src/murrine_draw_rgba.c
==============================================================================
--- trunk/src/murrine_draw_rgba.c	(original)
+++ trunk/src/murrine_draw_rgba.c	Wed Feb 27 12:55:13 2008
@@ -181,12 +181,14 @@
 	if (widget->ythickness > 1)
 		yoffset = 1;
 
-	if (!widget->active)
+	if (!widget->active && !widget->disabled && widget->reliefstyle > 1)
 	{
 		murrine_rounded_rectangle (cr, xoffset, yoffset, width-(xoffset*2), height-(yoffset*2), widget->roundness, widget->corners);
 		murrine_set_color_rgba (cr, widget->disabled ? &border_disabled : &border_normal, 0.16);
 		cairo_stroke (cr);
 	}
+	else if (widget->reliefstyle != 0)
+		murrine_draw_inset (cr, &widget->parentbg, 0.5, 0.5, width-1, height-1, widget->roundness+1, widget->corners);
 
 	murrine_mix_color (widget->disabled ? &border_disabled : &border_normal , &widget->parentbg, 0.2,
 	                   widget->disabled ? &border_disabled : &border_normal);
@@ -363,7 +365,8 @@
 
 	cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
 
-	murrine_draw_inset (cr, &widget->parentbg, 0, 0, width-1, height-1, radius+1, widget->corners);
+	if (widget->reliefstyle != 0)
+		murrine_draw_inset (cr, &widget->parentbg, 0, 0, width-1, height-1, radius+1, widget->corners);
 
 	/* Draw the focused border */
 	if (widget->focus)
@@ -464,7 +467,8 @@
 	cairo_set_line_width (cr, 1.0);
 	cairo_translate (cr, translate_x, translate_y);
 
-	murrine_draw_inset (cr, &widget->parentbg, 0, 0, trough_width+2, trough_height+2, 0, 0);
+	if (widget->reliefstyle != 0)
+		murrine_draw_inset (cr, &widget->parentbg, 0, 0, trough_width+2, trough_height+2, 0, 0);
 
 	cairo_translate (cr, 1, 1);
 
@@ -1683,10 +1687,13 @@
 
 	cairo_translate (cr, x, y);
 
-	cairo_set_line_width (cr, 2);
-	cairo_arc (cr, 7, 7, 6, 0, M_PI*2);
-	murrine_set_color_rgba (cr, &colors->shade[8], 0.12);
-	cairo_stroke (cr);
+	if (widget->reliefstyle > 1)
+	{
+		cairo_set_line_width (cr, 2.0);
+		cairo_arc (cr, 7, 7, 6, 0, M_PI*2);
+		murrine_set_color_rgba (cr, &colors->shade[8], 0.12);
+		cairo_stroke (cr);
+	}
 
 	cairo_set_line_width (cr, 1.0);
 
@@ -1777,9 +1784,12 @@
 
 	if (widget->xthickness > 2 && widget->ythickness > 2)
 	{
-		cairo_rectangle (cr, 0.5, 0.5, width-1, height-1);
-		murrine_set_color_rgba (cr, &colors->shade[8], 0.12);
-		cairo_stroke (cr);
+		if (widget->reliefstyle > 1)
+		{
+			cairo_rectangle (cr, 0.5, 0.5, width-1, height-1);
+			murrine_set_color_rgba (cr, &colors->shade[8], 0.12);
+			cairo_stroke (cr);
+		}
 
 		/* Draw the rectangle for the checkbox itself */
 		cairo_rectangle (cr, 1.5, 1.5, width-3, height-3);

Modified: trunk/src/murrine_rc_style.c
==============================================================================
--- trunk/src/murrine_rc_style.c	(original)
+++ trunk/src/murrine_rc_style.c	Wed Feb 27 12:55:13 2008
@@ -59,6 +59,7 @@
 	TOKEN_MENUBARSTYLE,
 	TOKEN_MENUITEMSTYLE,
 	TOKEN_MENUSTYLE,
+	TOKEN_RELIEFSTYLE,
 	TOKEN_RGBA,
 	TOKEN_ROUNDNESS,
 	TOKEN_SCROLLBAR_COLOR,
@@ -107,6 +108,7 @@
 	{ "menubarstyle",        TOKEN_MENUBARSTYLE },
 	{ "menuitemstyle",       TOKEN_MENUITEMSTYLE },
 	{ "menustyle",           TOKEN_MENUSTYLE },
+	{ "reliefstyle",         TOKEN_RELIEFSTYLE },
 	{ "rgba",                TOKEN_RGBA },
 	{ "roundness",           TOKEN_ROUNDNESS },
 	{ "scrollbar_color",     TOKEN_SCROLLBAR_COLOR },
@@ -178,6 +180,7 @@
 	murrine_rc->menubarstyle = 0;
 	murrine_rc->menuitemstyle = 1;
 	murrine_rc->menustyle = 1;
+	murrine_rc->reliefstyle = 2;
 	murrine_rc->rgba = TRUE;
 	murrine_rc->roundness = 1;
 	murrine_rc->scrollbarstyle = 0;
@@ -490,6 +493,10 @@
 				token = theme_parse_int (settings, scanner, &murrine_style->menustyle);
 				murrine_style->flags |= MRN_FLAG_MENUSTYLE;
 				break;
+			case TOKEN_RELIEFSTYLE:
+				token = theme_parse_int (settings, scanner, &murrine_style->reliefstyle);
+				murrine_style->flags |= MRN_FLAG_RELIEFSTYLE;
+				break;
 			case TOKEN_RGBA:
 				token = theme_parse_boolean (settings, scanner, &murrine_style->rgba);
 				murrine_style->flags |= MRN_FLAG_RGBA;
@@ -620,6 +627,8 @@
 		dest_w->menuitemstyle = src_w->menuitemstyle;
 	if (flags & MRN_FLAG_MENUSTYLE)
 		dest_w->menustyle = src_w->menustyle;
+	if (flags & MRN_FLAG_RELIEFSTYLE)
+		dest_w->reliefstyle = src_w->reliefstyle;
 	if (flags & MRN_FLAG_RGBA)
 		dest_w->rgba = src_w->rgba;
 	if (flags & MRN_FLAG_ROUNDNESS)

Modified: trunk/src/murrine_rc_style.h
==============================================================================
--- trunk/src/murrine_rc_style.h	(original)
+++ trunk/src/murrine_rc_style.h	Wed Feb 27 12:55:13 2008
@@ -52,14 +52,15 @@
 	MRN_FLAG_MENUBARSTYLE = 1 << 15,
 	MRN_FLAG_MENUITEMSTYLE = 1 << 16,
 	MRN_FLAG_MENUSTYLE = 1 << 17,
-	MRN_FLAG_RGBA = 1 << 18,
-	MRN_FLAG_ROUNDNESS = 1 << 19,
-	MRN_FLAG_SCROLLBAR_COLOR = 1 << 20,
-	MRN_FLAG_SCROLLBARSTYLE = 1 << 21,
-	MRN_FLAG_SLIDERSTYLE = 1 << 22,
-	MRN_FLAG_STEPPERSTYLE = 1 << 23,
-	MRN_FLAG_STYLE = 1 << 24,
-	MRN_FLAG_TOOLBARSTYLE = 1 << 25
+	MRN_FLAG_RELIEFSTYLE = 1 << 18,
+	MRN_FLAG_RGBA = 1 << 19,
+	MRN_FLAG_ROUNDNESS = 1 << 20,
+	MRN_FLAG_SCROLLBAR_COLOR = 1 << 21,
+	MRN_FLAG_SCROLLBARSTYLE = 1 << 22,
+	MRN_FLAG_SLIDERSTYLE = 1 << 23,
+	MRN_FLAG_STEPPERSTYLE = 1 << 24,
+	MRN_FLAG_STYLE = 1 << 25,
+	MRN_FLAG_TOOLBARSTYLE = 1 << 26
 } MurrineRcFlags;
 
 struct _MurrineRcStyle
@@ -84,6 +85,7 @@
 	guint8   menubarstyle;
 	guint8   menuitemstyle;
 	guint8   menustyle;
+	guint8   reliefstyle;
 	guint8   roundness;
 	guint8   scrollbarstyle;
 	guint8   sliderstyle;

Modified: trunk/src/murrine_style.c
==============================================================================
--- trunk/src/murrine_style.c	(original)
+++ trunk/src/murrine_style.c	Wed Feb 27 12:55:13 2008
@@ -135,6 +135,7 @@
 	params->lightborder_ratio = murrine_style->lightborder_ratio;
 	params->lightborderstyle  = murrine_style->lightborderstyle;
 	params->glazestyle        = murrine_style->glazestyle;
+	params->reliefstyle       = murrine_style->reliefstyle;
 	params->roundness         = murrine_style->roundness;
 	params->highlight_ratio   = murrine_style->highlight_ratio;
 
@@ -1650,6 +1651,7 @@
 	murrine_style->gradients           = MURRINE_RC_STYLE (rc_style)->gradients;
 	murrine_style->colorize_scrollbar  = MURRINE_RC_STYLE (rc_style)->colorize_scrollbar;
 	murrine_style->rgba                = MURRINE_RC_STYLE (rc_style)->rgba;
+	murrine_style->reliefstyle         = MURRINE_RC_STYLE (rc_style)->reliefstyle;
 
 	if (murrine_style->has_scrollbar_color)
 		murrine_style->scrollbar_color = MURRINE_RC_STYLE (rc_style)->scrollbar_color;
@@ -1674,6 +1676,14 @@
 			murrine_style->glazestyle = 0;
 			murrine_style->gradients = FALSE;
 			murrine_style->has_gradient_stop = FALSE;
+			murrine_style->lightborder_ratio = 1.00;
+			murrine_style->sliderstyle = 1;
+			murrine_style->scrollbarstyle = 0;
+			murrine_style->stepperstyle = 0;
+			murrine_style->colorize_scrollbar = FALSE;
+			murrine_style->has_scrollbar_color = FALSE;
+			murrine_style->reliefstyle = 0;
+			murrine_style->roundness = 0;
 			break;
 		case (MRN_STYLE_CANDIDO):
 			murrine_style->highlight_ratio = 1.0;
@@ -1685,6 +1695,7 @@
 			murrine_style->gradient_stop_3 = 0.99;
 			murrine_style->gradient_stop_4 = 0.97;
 			murrine_style->has_gradient_stop = TRUE;
+			murrine_style->reliefstyle = 0;
 			break;
 		case (MRN_STYLE_CLEARLOOKS):
 			murrine_style->glazestyle = 0;
@@ -1883,6 +1894,7 @@
 	mrn_style->menubarstyle        = mrn_src->menubarstyle;
 	mrn_style->menuitemstyle       = mrn_src->menuitemstyle;
 	mrn_style->menustyle           = mrn_src->menustyle;
+	mrn_style->reliefstyle         = mrn_src->reliefstyle;
 	mrn_style->rgba                = mrn_src->rgba;
 	mrn_style->roundness           = mrn_src->roundness;
 	mrn_style->scrollbar_color     = mrn_src->scrollbar_color;

Modified: trunk/src/murrine_style.h
==============================================================================
--- trunk/src/murrine_style.h	(original)
+++ trunk/src/murrine_style.h	Wed Feb 27 12:55:13 2008
@@ -62,6 +62,7 @@
 	guint8   menubarstyle;
 	guint8   menuitemstyle;
 	guint8   menustyle;
+	guint8   reliefstyle;
 	guint8   roundness;
 	guint8   scrollbarstyle;
 	guint8   sliderstyle;

Modified: trunk/src/murrine_types.h
==============================================================================
--- trunk/src/murrine_types.h	(original)
+++ trunk/src/murrine_types.h	Wed Feb 27 12:55:13 2008
@@ -202,6 +202,7 @@
 	/* Style */
 	int glazestyle;
 	int lightborderstyle;
+	int reliefstyle;
 	int roundness;
 	double highlight_ratio;
 	double lightborder_ratio;



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