gtk-engines r1337 - in trunk: . engines/clearlooks/src themes/Clearlooks/gtk-2.0



Author: acimitan
Date: Tue Mar 10 18:48:44 2009
New Revision: 1337
URL: http://svn.gnome.org/viewvc/gtk-engines?rev=1337&view=rev

Log:
2009-03-10  Andrea Cimitan  <andrea cimitan gmail com

	* engines/clearlooks/src/clearlooks_draw.c (clearlooks_draw_entry):
	* engines/clearlooks/src/clearlooks_draw_gummy.c
	(clearlooks_gummy_draw_entry):
	* engines/clearlooks/src/clearlooks_style.c
	(clearlooks_style_draw_shadow):
	* engines/clearlooks/src/clearlooks_types.h:
	* themes/Clearlooks/gtk-2.0/gtkrc:
	Fixed a regression in the focus color of the GtkEntry introduced with
	the entry_progress commits.


Modified:
   trunk/ChangeLog
   trunk/engines/clearlooks/src/clearlooks_draw.c
   trunk/engines/clearlooks/src/clearlooks_draw_gummy.c
   trunk/engines/clearlooks/src/clearlooks_style.c
   trunk/engines/clearlooks/src/clearlooks_types.h
   trunk/themes/Clearlooks/gtk-2.0/gtkrc

Modified: trunk/engines/clearlooks/src/clearlooks_draw.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_draw.c	(original)
+++ trunk/engines/clearlooks/src/clearlooks_draw.c	Tue Mar 10 18:48:44 2009
@@ -413,6 +413,7 @@
 clearlooks_draw_entry (cairo_t *cr,
                        const ClearlooksColors *colors,
                        const WidgetParameters *params,
+                       const FocusParameters  *focus,
                        int x, int y, int width, int height)
 {
 	const CairoColor *base = &colors->base[params->state_type];
@@ -420,7 +421,7 @@
 	double radius = MIN (params->radius, MIN ((width - 4.0) / 2.0, (height - 4.0) / 2.0));
 
 	if (params->focus)
-		border = colors->spot[2];
+		border = focus->color;
 
 	cairo_save (cr);
 
@@ -437,6 +438,7 @@
 	/* Draw the inner shadow */
 	if (params->focus)
 	{
+		/* XXX Fix this with focus->has_color */
 		ge_cairo_set_color (cr, &colors->spot[0]);
 		ge_cairo_inner_rounded_rectangle (cr, 2, 2, width-4, height-4, MAX(0, radius-1), params->corners);
 		cairo_stroke (cr);

Modified: trunk/engines/clearlooks/src/clearlooks_draw_gummy.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_draw_gummy.c	(original)
+++ trunk/engines/clearlooks/src/clearlooks_draw_gummy.c	Tue Mar 10 18:48:44 2009
@@ -261,6 +261,7 @@
 clearlooks_gummy_draw_entry (cairo_t                *cr,
                              const ClearlooksColors *colors,
                              const WidgetParameters *params,
+                             const FocusParameters  *focus,
                              int x, int y, int width, int height)
 {
 	const CairoColor *base = &colors->base[params->state_type];
@@ -268,7 +269,7 @@
 	double radius = MIN (params->radius, MIN ((width - 4.0) / 2.0, (height - 4.0) / 2.0));
 
 	if (params->focus)
-		border = colors->spot[2];
+		border = focus->color;
 
 	cairo_save (cr);
 
@@ -285,6 +286,7 @@
 	/* Draw the inner shadow */
 	if (params->focus)
 	{
+		/* XXX Fix this with focus->has_color */
 		clearlooks_set_mixed_color (cr, base, &colors->spot[1], 0.5);
 		ge_cairo_inner_rounded_rectangle (cr, 2, 2, width-4, height-4, MAX(0, radius-1), params->corners);
 		cairo_stroke (cr);

Modified: trunk/engines/clearlooks/src/clearlooks_style.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_style.c	(original)
+++ trunk/engines/clearlooks/src/clearlooks_style.c	Tue Mar 10 18:48:44 2009
@@ -183,6 +183,7 @@
 	    (DETAIL ("frame") && CHECK_HINT (GE_HINT_COMBOBOX_ENTRY)))
 	{
 		WidgetParameters params;
+		FocusParameters  focus;
 
 		/* Override the entries state type, because we are too lame to handle this via
 		 * the focus ring, and GtkEntry doesn't even set the INSENSITIVE state ... */
@@ -214,7 +215,16 @@
 			cairo_fill (cr);
 		}
 
-		STYLE_FUNCTION (draw_entry) (cr, &clearlooks_style->colors, &params,
+		/* Focus color */
+		if (clearlooks_style->has_focus_color)
+		{
+			ge_gdk_color_to_cairo (&clearlooks_style->focus_color, &focus.color);
+			focus.has_color = TRUE;
+		}
+		else
+			focus.color = colors->spot[2];
+
+		STYLE_FUNCTION (draw_entry) (cr, &clearlooks_style->colors, &params, &focus,
 		                             x, y, width, height);
 	}
 	else if (DETAIL ("frame") && CHECK_HINT (GE_HINT_STATUSBAR))

Modified: trunk/engines/clearlooks/src/clearlooks_types.h
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_types.h	(original)
+++ trunk/engines/clearlooks/src/clearlooks_types.h	Tue Mar 10 18:48:44 2009
@@ -370,6 +370,7 @@
 	void (*draw_entry)            (cairo_t *cr,
 	                               const ClearlooksColors *colors,
 	                               const WidgetParameters *widget,
+	                               const FocusParameters  *focus,
 	                               int x, int y, int width, int height);
 
 	void (*draw_entry_progress)   (cairo_t *cr,

Modified: trunk/themes/Clearlooks/gtk-2.0/gtkrc
==============================================================================
--- trunk/themes/Clearlooks/gtk-2.0/gtkrc	(original)
+++ trunk/themes/Clearlooks/gtk-2.0/gtkrc	Tue Mar 10 18:48:44 2009
@@ -100,6 +100,10 @@
 
 	bg[SELECTED] = mix (0.4, @selected_bg_color, @base_color)
 	fg[SELECTED] = @text_color
+
+	engine "clearlooks" {
+		focus_color = shade (0.896, @selected_bg_color)
+	}
 }
 
 style "spinbutton" {



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