[murrine] - New option: cellstyle = 0 to remove the border around the selected cell. cellstyle =



commit 4afc8fd2db853a1d6574619f4be79a8f94d57ad5
Author: Andrea <andrea cimitan gmail com>
Date:   Thu Mar 25 20:08:22 2010 +0100

    - New option: cellstyle = 0 to remove the border around the selected cell.
                  cellstyle = 1 for the border around the selected cell (as before).

 NEWS                     |    2 +
 schema/murrine.xml.in.in |   11 ++++++++
 src/murrine_draw.c       |    3 +-
 src/murrine_rc_style.c   |    9 +++++++
 src/murrine_rc_style.h   |   60 +++++++++++++++++++++++----------------------
 src/murrine_style.c      |    7 ++++-
 src/murrine_style.h      |    1 +
 src/murrine_types.h      |    6 ++++
 8 files changed, 68 insertions(+), 31 deletions(-)
---
diff --git a/NEWS b/NEWS
index e3ed2d2..bfbe10d 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ Changes in this release:
 - New option: border_colors = { "#ffffff", "#ffffff" }
               to set the colors used on the border of many widgets.
               border_colors = FALSE to disable.
+- New option: cellstyle = 0 to remove the border around the selected cell.
+              cellstyle = 1 for the border around the selected cell (as before).
 - New option: comboboxstyle = 1 to colorize the GtkComboBox below the arrow.
 - New option: disable_focus = TRUE to disable focus drawing.
 - New option: gradient_colors = { "#ffffff", "#ffffff", "#ffffff", "#ffffff" }
diff --git a/schema/murrine.xml.in.in b/schema/murrine.xml.in.in
index ea425be..104759f 100644
--- a/schema/murrine.xml.in.in
+++ b/schema/murrine.xml.in.in
@@ -33,6 +33,17 @@
 		<section>Scrolls and Lists</section>
 	</option>
 
+	<option type="enumeration" name="cellstyle" default="1">
+		<_long_name>Cell Style</_long_name>
+		<section>General</section>
+		<enumeration value="0">
+			<label>No effect</label>
+		</enumeration>
+		<enumeration value="1">
+			<label>Border on top and bottom</label>
+		</enumeration>
+	</option>
+
 	<option type="enumeration" name="comboboxstyle" default="0">
 		<_long_name>Combobox Style</_long_name>
 		<section>General</section>
diff --git a/src/murrine_draw.c b/src/murrine_draw.c
index 5f37e5f..104362e 100644
--- a/src/murrine_draw.c
+++ b/src/murrine_draw.c
@@ -1964,6 +1964,7 @@ static void
 murrine_draw_selected_cell (cairo_t *cr,
                             const MurrineColors    *colors,
                             const WidgetParameters *widget,
+                            const CellParameters   *cell,
                             int x, int y, int width, int height)
 {
 	cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
@@ -1971,7 +1972,7 @@ murrine_draw_selected_cell (cairo_t *cr,
 	MurrineRGB fill = widget->focus ? colors->base[widget->state_type] :
 	                                  colors->base[GTK_STATE_ACTIVE];
 	MurrineRGB border;
-	murrine_shade (&fill, (!widget->mrn_gradient.gradients ? 0.9 : 0.95), &border);
+	murrine_shade (&fill, (cell->style != 0 ? !widget->mrn_gradient.gradients ? 0.9 : 0.95 : 1.0), &border);
 
 	cairo_save (cr);
 	cairo_translate (cr, x, y);
diff --git a/src/murrine_rc_style.c b/src/murrine_rc_style.c
index 3143d92..8000796 100644
--- a/src/murrine_rc_style.c
+++ b/src/murrine_rc_style.c
@@ -40,6 +40,7 @@ enum
 	TOKEN_BORDER_COLORS,
 	TOKEN_BORDER_SHADES,
 	TOKEN_COLORIZE_SCROLLBAR,
+	TOKEN_CELLSTYLE,
 	TOKEN_COMBOBOXSTYLE,
 	TOKEN_CONTRAST,
 	TOKEN_DISABLE_FOCUS,
@@ -99,6 +100,7 @@ theme_symbols[] =
 	{ "border_colors",       TOKEN_BORDER_COLORS },
 	{ "border_shades",       TOKEN_BORDER_SHADES },
 	{ "colorize_scrollbar",  TOKEN_COLORIZE_SCROLLBAR },
+	{ "cellstyle",           TOKEN_CELLSTYLE },	
 	{ "comboboxstyle",       TOKEN_COMBOBOXSTYLE },
 	{ "contrast",            TOKEN_CONTRAST },
 	{ "disable_focus",       TOKEN_DISABLE_FOCUS },
@@ -163,6 +165,7 @@ murrine_rc_style_init (MurrineRcStyle *murrine_rc)
 	murrine_rc->arrowstyle = 0;
 	murrine_rc->border_shades[0] = 1.0;
 	murrine_rc->border_shades[1] = 1.0;
+	murrine_rc->cellstyle = 1;
 	murrine_rc->colorize_scrollbar = TRUE;
 	murrine_rc->comboboxstyle = 0;
 	murrine_rc->contrast = 1.0;
@@ -622,6 +625,10 @@ murrine_rc_style_parse (GtkRcStyle *rc_style,
 				token = theme_parse_border (settings, scanner, murrine_style->border_shades);
 				murrine_style->gflags |= MRN_FLAG_BORDER_SHADES;
 				break;
+			case TOKEN_CELLSTYLE:
+				token = theme_parse_int (settings, scanner, &murrine_style->cellstyle);
+				murrine_style->flags |= MRN_FLAG_CELLSTYLE;
+				break;
 			case TOKEN_COLORIZE_SCROLLBAR:
 				token = theme_parse_boolean (settings, scanner, &murrine_style->colorize_scrollbar);
 				murrine_style->flags |= MRN_FLAG_COLORIZE_SCROLLBAR;
@@ -833,6 +840,8 @@ murrine_rc_style_merge (GtkRcStyle *dest,
 		dest_w->animation = src_w->animation;
 	if (flags & MRN_FLAG_ARROWSTYLE)
 		dest_w->arrowstyle = src_w->arrowstyle;
+	if (flags & MRN_FLAG_CELLSTYLE)
+		dest_w->cellstyle = src_w->cellstyle;
 	if (flags & MRN_FLAG_COLORIZE_SCROLLBAR)
 		dest_w->colorize_scrollbar = src_w->colorize_scrollbar;
 	if (flags & MRN_FLAG_COMBOBOXSTYLE)
diff --git a/src/murrine_rc_style.h b/src/murrine_rc_style.h
index 51265d5..c9278b1 100644
--- a/src/murrine_rc_style.h
+++ b/src/murrine_rc_style.h
@@ -37,35 +37,36 @@ typedef enum
 {
 	MRN_FLAG_ANIMATION = 1 << 0,
 	MRN_FLAG_ARROWSTYLE = 1 << 1,
-	MRN_FLAG_COLORIZE_SCROLLBAR = 1 << 2,
-	MRN_FLAG_COMBOBOXSTYLE = 1 << 3,
-	MRN_FLAG_CONTRAST = 1 << 4,
-	MRN_FLAG_DISABLE_FOCUS = 1 << 5,
-	MRN_FLAG_FOCUS_COLOR = 1 << 6,
-	MRN_FLAG_GLAZESTYLE = 1 << 7,
-	MRN_FLAG_GLOW_SHADE = 1 << 8,
-	MRN_FLAG_GLOWSTYLE = 1 << 9,
-	MRN_FLAG_HIGHLIGHT_SHADE = 1 << 10,
-	MRN_FLAG_LIGHTBORDER_SHADE = 1 << 11,
-	MRN_FLAG_LIGHTBORDERSTYLE= 1 << 12,
-	MRN_FLAG_LISTVIEWHEADERSTYLE = 1 << 13,
-	MRN_FLAG_LISTVIEWSTYLE = 1 << 14,
-	MRN_FLAG_MENUBARITEMSTYLE = 1 << 15,
-	MRN_FLAG_MENUBARSTYLE = 1 << 16,
-	MRN_FLAG_MENUITEMSTYLE = 1 << 17,
-	MRN_FLAG_MENUSTYLE = 1 << 18,
-	MRN_FLAG_PRELIGHT_SHADE = 1 << 19,
-	MRN_FLAG_PROGRESSBARSTYLE = 1 << 20,
-	MRN_FLAG_RELIEFSTYLE = 1 << 21,
-	MRN_FLAG_RGBA = 1 << 22,
-	MRN_FLAG_ROUNDNESS = 1 << 23,
-	MRN_FLAG_SCROLLBARSTYLE = 1 << 24,
-	MRN_FLAG_SEPARATORSTYLE = 1 << 25,
-	MRN_FLAG_SLIDERSTYLE = 1 << 26,
-	MRN_FLAG_SPINBUTTONSTYLE = 1 << 27,
-	MRN_FLAG_STEPPERSTYLE = 1 << 28,
-	MRN_FLAG_TEXTSTYLE = 1 << 29,
-	MRN_FLAG_TOOLBARSTYLE = 1 << 30
+	MRN_FLAG_CELLSTYLE = 1 << 2,
+	MRN_FLAG_COLORIZE_SCROLLBAR = 1 << 3,
+	MRN_FLAG_COMBOBOXSTYLE = 1 << 4,
+	MRN_FLAG_CONTRAST = 1 << 5,
+	MRN_FLAG_DISABLE_FOCUS = 1 << 6,
+	MRN_FLAG_FOCUS_COLOR = 1 << 7,
+	MRN_FLAG_GLAZESTYLE = 1 << 8,
+	MRN_FLAG_GLOW_SHADE = 1 << 9,
+	MRN_FLAG_GLOWSTYLE = 1 << 10,
+	MRN_FLAG_HIGHLIGHT_SHADE = 1 << 11,
+	MRN_FLAG_LIGHTBORDER_SHADE = 1 << 12,
+	MRN_FLAG_LIGHTBORDERSTYLE= 1 << 13,
+	MRN_FLAG_LISTVIEWHEADERSTYLE = 1 << 14,
+	MRN_FLAG_LISTVIEWSTYLE = 1 << 15,
+	MRN_FLAG_MENUBARITEMSTYLE = 1 << 16,
+	MRN_FLAG_MENUBARSTYLE = 1 << 17,
+	MRN_FLAG_MENUITEMSTYLE = 1 << 18,
+	MRN_FLAG_MENUSTYLE = 1 << 19,
+	MRN_FLAG_PRELIGHT_SHADE = 1 << 20,
+	MRN_FLAG_PROGRESSBARSTYLE = 1 << 21,
+	MRN_FLAG_RELIEFSTYLE = 1 << 22,
+	MRN_FLAG_RGBA = 1 << 23,
+	MRN_FLAG_ROUNDNESS = 1 << 24,
+	MRN_FLAG_SCROLLBARSTYLE = 1 << 25,
+	MRN_FLAG_SEPARATORSTYLE = 1 << 26,
+	MRN_FLAG_SLIDERSTYLE = 1 << 27,
+	MRN_FLAG_SPINBUTTONSTYLE = 1 << 28,
+	MRN_FLAG_STEPPERSTYLE = 1 << 29,
+	MRN_FLAG_TEXTSTYLE = 1 << 30,
+	MRN_FLAG_TOOLBARSTYLE = 1 << 31
 } MurrineRcFlags;
 
 typedef enum
@@ -96,6 +97,7 @@ struct _MurrineRcStyle
 	double   trough_shades[2];
 
 	guint8   arrowstyle;
+	guint8   cellstyle;
 	guint8   comboboxstyle;
 	guint8   glazestyle;
 	guint8   glowstyle;
diff --git a/src/murrine_style.c b/src/murrine_style.c
index 323d513..0ef7dcf 100644
--- a/src/murrine_style.c
+++ b/src/murrine_style.c
@@ -251,10 +251,13 @@ murrine_style_draw_flat_box (DRAW_ARGS)
 		cr = murrine_begin_paint (window, area);
 
 		WidgetParameters params;
+		CellParameters cell;
+
+		cell.style = murrine_style->cellstyle;
 
 		murrine_set_widget_parameters (widget, style, state_type, &params);
 
-		STYLE_FUNCTION(draw_selected_cell) (cr, colors, &params, x, y, width, height);
+		STYLE_FUNCTION(draw_selected_cell) (cr, colors, &params, &cell, x, y, width, height);
 
 		cairo_destroy (cr);
 	}
@@ -2317,6 +2320,7 @@ murrine_style_init_from_rc (GtkStyle   *style,
 		murrine_style->roundness = MURRINE_RC_STYLE (rc_style)->roundness;
 	murrine_style->animation           = MURRINE_RC_STYLE (rc_style)->animation;
 	murrine_style->arrowstyle          = MURRINE_RC_STYLE (rc_style)->arrowstyle;
+	murrine_style->cellstyle           = MURRINE_RC_STYLE (rc_style)->cellstyle;
 	murrine_style->comboboxstyle       = MURRINE_RC_STYLE (rc_style)->comboboxstyle;
 	murrine_style->contrast            = MURRINE_RC_STYLE (rc_style)->contrast;
 	murrine_style->colorize_scrollbar  = MURRINE_RC_STYLE (rc_style)->colorize_scrollbar;
@@ -2447,6 +2451,7 @@ murrine_style_copy (GtkStyle *style, GtkStyle *src)
 	mrn_style->border_colors[1]    = mrn_src->border_colors[1];
 	mrn_style->border_shades[0]    = mrn_src->border_shades[0];
 	mrn_style->border_shades[1]    = mrn_src->border_shades[1];
+	mrn_style->cellstyle           = mrn_src->cellstyle;
 	mrn_style->colorize_scrollbar  = mrn_src->colorize_scrollbar;
 	mrn_style->colors              = mrn_src->colors;
 	mrn_style->comboboxstyle       = mrn_src->comboboxstyle;
diff --git a/src/murrine_style.h b/src/murrine_style.h
index 3bfbcf0..1301b09 100644
--- a/src/murrine_style.h
+++ b/src/murrine_style.h
@@ -53,6 +53,7 @@ struct _MurrineStyle
 	double   trough_shades[2];
 
 	guint8   arrowstyle;
+	guint8   cellstyle;
 	guint8   comboboxstyle;
 	guint8   glazestyle;
 	guint8   glowstyle;
diff --git a/src/murrine_types.h b/src/murrine_types.h
index 5d8c97b..d5e410e 100644
--- a/src/murrine_types.h
+++ b/src/murrine_types.h
@@ -206,6 +206,11 @@ typedef struct
 
 typedef struct
 {
+	int style;
+} CellParameters;
+
+typedef struct
+{
 	MurrineShadowType shadow_type;
 	boolean           in_cell;
 	boolean           in_menu;
@@ -504,6 +509,7 @@ struct _MurrineStyleFunctions
 	void (*draw_selected_cell) (cairo_t *cr,
 	                            const MurrineColors    *colors,
 	                            const WidgetParameters *widget,
+	                            const CellParameters   *cell,
 	                            int x, int y, int width, int height);
 
 	void (*draw_statusbar) (cairo_t *cr,



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