murrine r32 - in trunk: . src



Author: acimitan
Date: Tue Apr  1 14:06:49 2008
New Revision: 32
URL: http://svn.gnome.org/viewvc/murrine?rev=32&view=rev

Log:
2008-04-01  Andrea Cimitan  <andrea cimitan gmail com>

	* src/murrine_draw_rgba.c: (murrine_rgba_draw_menubar):
	* src/murrine_style.c: (murrine_style_draw_box):
	* src/support.h:
	Less opacity, less transparency on windows (testing, tell me if it is ugly)
	GTK_SHADOW_NONE support on RGBA menubars


Modified:
   trunk/ChangeLog
   trunk/src/murrine_draw_rgba.c
   trunk/src/murrine_style.c
   trunk/src/support.h

Modified: trunk/src/murrine_draw_rgba.c
==============================================================================
--- trunk/src/murrine_draw_rgba.c	(original)
+++ trunk/src/murrine_draw_rgba.c	Tue Apr  1 14:06:49 2008
@@ -734,8 +734,22 @@
 	}
 	else /* Flat menubar */
 	{
-		murrine_set_color_rgba (cr, fill, MENUBAR_OPACITY);
-		cairo_fill (cr);
+		cairo_pattern_t *pattern;
+
+		pattern = cairo_pattern_create_linear (0, 0, width, 0);
+		cairo_pattern_add_color_stop_rgba (pattern, 0.0, fill->r,
+		                                                 fill->g,
+		                                                 fill->b, MENUBAR_OPACITY);
+		cairo_pattern_add_color_stop_rgba (pattern, 0.5, fill->r,
+		                                                 fill->g,
+		                                                 fill->b, (MENUBAR_OPACITY-0.04));
+		cairo_pattern_add_color_stop_rgba (pattern, 1.0, fill->r,
+		                                                 fill->g,
+		                                                 fill->b, MENUBAR_OPACITY);
+		cairo_set_source (cr, pattern);
+		cairo_rectangle  (cr, 0, 0, width, height);
+		cairo_fill       (cr);
+		cairo_pattern_destroy (pattern);
 
 		cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
 	}

Modified: trunk/src/murrine_style.c
==============================================================================
--- trunk/src/murrine_style.c	(original)
+++ trunk/src/murrine_style.c	Tue Apr  1 14:06:49 2008
@@ -683,19 +683,27 @@
 	{
 		WidgetParameters params;
 		gboolean horizontal;
+		int menubarstyle = murrine_style->menubarstyle;
+		int offset = 0;
 
 		murrine_set_widget_parameters (widget, style, state_type, &params);
 
 		if (params.mrn_gradient.use_rgba)
 		{
 			params.mrn_gradient.rgba_opacity = MENUBAR_GLOSSY_OPACITY;
+			if (shadow_type == GTK_SHADOW_NONE)
+			{
+				offset = 1;
+				menubarstyle = 0;
+			}
 		}
 
 		horizontal = height < 2*width;
+
 		/* This is not that great. Ideally we would have a nice vertical menubar. */
 		if (params.mrn_gradient.use_rgba || ((shadow_type != GTK_SHADOW_NONE) && horizontal))
-			STYLE_FUNCTION(draw_menubar) (cr, colors, &params, x, y, width, height,
-			                              murrine_style->menubarstyle);
+			STYLE_FUNCTION(draw_menubar) (cr, colors, &params, x, y,
+			                              width, height+offset, menubarstyle);
 	}
 	else if (DETAIL ("button") && widget && widget->parent &&
 	                 (MRN_IS_TREE_VIEW(widget->parent) ||

Modified: trunk/src/support.h
==============================================================================
--- trunk/src/support.h	(original)
+++ trunk/src/support.h	Tue Apr  1 14:06:49 2008
@@ -33,13 +33,13 @@
 
 /* Opacity settings */
 #define GRADIENT_OPACITY 0.90
-#define WINDOW_OPACITY 0.86
+#define WINDOW_OPACITY 0.88
 #define ENTRY_OPACITY 0.90
 #define NOTEBOOK_OPACITY 0.92
-#define MENUBAR_OPACITY 0.92
+#define MENUBAR_OPACITY 0.88
 #define MENUBAR_GLOSSY_OPACITY 0.88
 #define MENUBAR_STRIPED_OPACITY 0.94
-#define TOOLBAR_OPACITY 0.89
+#define TOOLBAR_OPACITY 0.88
 #define TOOLBAR_GLOSSY_OPACITY 0.88
 #define MENU_OPACITY 0.90
 #define TOOLTIP_OPACITY 0.90



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