murrine r15 - in trunk: . src



Author: acimitan
Date: Tue Feb 19 19:57:50 2008
New Revision: 15
URL: http://svn.gnome.org/viewvc/murrine?rev=15&view=rev

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

	* src/murrine_draw_rgba.c: (murrine_rgba_draw_tooltip),
	(murrine_rgba_draw_menu_frame), (murrine_register_style_rgba):
	* src/murrine_style.c: (murrine_style_draw_flat_box),
	(murrine_style_draw_shadow):
	* src/support.h:
	Rounded Tooltips


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 Feb 19 19:57:50 2008
@@ -1560,7 +1560,7 @@
 		}
 	}
 }
-/*
+
 static void
 murrine_rgba_draw_tooltip (cairo_t *cr,
                            const MurrineColors    *colors,
@@ -1583,25 +1583,27 @@
 
 	cairo_translate (cr, x, y);
 	cairo_set_line_width (cr, 1.0);
+	cairo_rectangle (cr, 0, 0, width, height);
 	cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
-	cairo_paint (cr);
-	cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
+	cairo_fill (cr);
+	cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
 
 	murrine_set_gradient (cr, &colors->bg[widget->state_type], mrn_gradient_custom, 0, 0, 0, height, widget->mrn_gradient.gradients, FALSE);
-	murrine_rounded_rectangle (cr, 0, 0, width, height, widget->roundness, MRN_CORNER_ALL);
+	clearlooks_rounded_rectangle (cr, 0, 0, width, height, widget->roundness > 1 ? widget->roundness+1 : 0, widget->corners);
 	cairo_fill (cr);
 
 	murrine_set_gradient (cr, &highlight, mrn_gradient_custom, 0, 0, 0, height, widget->mrn_gradient.gradients, TRUE);
-	murrine_rounded_rectangle (cr, 0, 0, width, height/2, widget->roundness, MRN_CORNER_TOPLEFT | MRN_CORNER_TOPRIGHT);
+	clearlooks_rounded_rectangle (cr, 0, 0, width, height/2, widget->roundness > 1 ? widget->roundness+1 : 0, 
+	                              widget->corners == MRN_CORNER_ALL ? MRN_CORNER_TOPLEFT | MRN_CORNER_TOPRIGHT : MRN_CORNER_NONE);
 	cairo_fill (cr);
 
 	murrine_set_color_rgb (cr, &border);
-	murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, MRN_CORNER_ALL);
+	murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners);
 	cairo_stroke (cr);
 
 	cairo_restore (cr);
 }
-*/
+
 static void
 murrine_rgba_draw_handle (cairo_t *cr,
                           const MurrineColors    *colors,
@@ -1872,7 +1874,7 @@
 	cairo_paint (cr);
 	cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
 
-	clearlooks_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, corners);
+	clearlooks_rounded_rectangle (cr, 0, 0, width, height, widget->roundness > 1 ? widget->roundness+1 : 0, corners);
 	murrine_set_color_rgba (cr, &colors->bg[0], MENU_OPACITY);
 	cairo_fill (cr);
 
@@ -1935,7 +1937,7 @@
 	functions->draw_scrollbar_stepper  = murrine_rgba_draw_scrollbar_stepper;
 	functions->draw_scrollbar_slider   = murrine_rgba_draw_scrollbar_slider;
 	functions->draw_handle             = murrine_rgba_draw_handle;
-	/* functions->draw_tooltip            = murrine_rgba_draw_tooltip; */
+	functions->draw_tooltip            = murrine_rgba_draw_tooltip;
 	functions->draw_radiobutton        = murrine_rgba_draw_radiobutton;
 	functions->draw_checkbox           = murrine_rgba_draw_checkbox;
 	functions->draw_menu_frame         = murrine_rgba_draw_menu_frame;

Modified: trunk/src/murrine_style.c
==============================================================================
--- trunk/src/murrine_style.c	(original)
+++ trunk/src/murrine_style.c	Tue Feb 19 19:57:50 2008
@@ -209,6 +209,7 @@
 		MurrineStyle  *murrine_style = MURRINE_STYLE (style);
 		MurrineColors *colors = &murrine_style->colors;
 		cairo_t       *cr;
+/*		GtkWidget     *parent; */
 
 		CHECK_ARGS
 		SANITIZE_SIZE
@@ -218,6 +219,17 @@
 		WidgetParameters params;
 
 		murrine_set_widget_parameters (widget, style, state_type, &params);
+		if (params.mrn_gradient.use_rgba)
+		{
+			params.corners = MRN_CORNER_ALL;
+			params.mrn_gradient.rgba_opacity = TOOLTIP_OPACITY;
+		}
+
+/*		Not working...
+		parent = gtk_widget_get_parent (widget);
+		if (GTK_IS_TOOLTIP (parent))
+			params.corners = MRN_CORNER_NONE;
+*/
 
 		STYLE_FUNCTION(draw_tooltip) (cr, colors, &params, x, y, width, height);
 
@@ -357,7 +369,6 @@
 		WidgetParameters params;
 
 		murrine_set_widget_parameters (widget, style, state_type, &params);
-		params.roundness = murrine_style->roundness;
 
 		if (widget && (MRN_IS_COMBO (widget->parent) ||
 		               MRN_IS_COMBO_BOX_ENTRY(widget->parent) ||

Modified: trunk/src/support.h
==============================================================================
--- trunk/src/support.h	(original)
+++ trunk/src/support.h	Tue Feb 19 19:57:50 2008
@@ -42,6 +42,7 @@
 #define TOOLBAR_OPACITY 0.89
 #define TOOLBAR_GLOSSY_OPACITY 0.88
 #define MENU_OPACITY 0.90
+#define TOOLTIP_OPACITY 0.90
 
 /* From gtk-engines 20071109 */
 #define MRN_IS_WIDGET(object) ((object)  && murrine_object_is_a ((GObject*)(object), "GtkWidget"))



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