[maemo-commits] [maemo-commits] r10034 - in projects/haf/trunk/sapwood: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Feb 20 09:36:53 EET 2007
Author: xan
Date: 2007-02-20 09:36:52 +0200 (Tue, 20 Feb 2007)
New Revision: 10034

Modified:
   projects/haf/trunk/sapwood/ChangeLog
   projects/haf/trunk/sapwood/src/sapwood-draw.c
Log:
	* sapwood-draw.c (draw_option, draw_check):
	Add special casing for GtkCheckButton and GtkRadioButton to use
	the correct graphics in the theme when the widgets have focus.


Modified: projects/haf/trunk/sapwood/ChangeLog
===================================================================
--- projects/haf/trunk/sapwood/ChangeLog	2007-02-20 07:26:46 UTC (rev 10033)
+++ projects/haf/trunk/sapwood/ChangeLog	2007-02-20 07:36:52 UTC (rev 10034)
@@ -1,3 +1,9 @@
+2007-02-20  Xan Lopez  <xan.lopez at nokia.com>
+
+	* sapwood-draw.c (draw_option, draw_check):
+	Add special casing for GtkCheckButton and GtkRadioButton to use
+	the correct graphics in the theme when the widgets have focus.
+
 2007-02-06  Tommi Komulainen  <tommi.komulainen at nokia.com>
 
 	* === Release 2.91.2 ===

Modified: projects/haf/trunk/sapwood/src/sapwood-draw.c
===================================================================
--- projects/haf/trunk/sapwood/src/sapwood-draw.c	2007-02-20 07:26:46 UTC (rev 10033)
+++ projects/haf/trunk/sapwood/src/sapwood-draw.c	2007-02-20 07:36:52 UTC (rev 10034)
@@ -874,7 +874,15 @@
   match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
   match_data.shadow = shadow;
   match_data.state = state;
-  
+
+  /* Special casing for GtkCheckButton: We want to set the widget state to
+   * ACTIVE to get the correct graphics used in the RC files. Ideally we'd
+   * use the FOCUS rules, but this is not possible due to technical limitations
+   * in how focus is drawn in sapwood */
+  if (GTK_IS_CHECK_BUTTON (widget) &&
+      GTK_WIDGET_HAS_FOCUS (widget))
+    match_data.state = GTK_STATE_ACTIVE;
+
   if (!draw_simple_image (style, window, area, widget, &match_data, TRUE,
 			  x, y, width, height))
     parent_class->draw_check (style, window, state, shadow, area, widget, detail,
@@ -905,6 +913,14 @@
   match_data.shadow = shadow;
   match_data.state = state;
   
+  /* Special casing for GtkRadioButton: We want to set the widget state to
+   * ACTIVE to get the correct graphics used in the RC files. Ideally we'd
+   * use the FOCUS rules, but this is not possible due to technical limitations
+   * in how focus is drawn in sapwood */
+  if (GTK_IS_RADIO_BUTTON (widget) &&
+      GTK_WIDGET_HAS_FOCUS (widget))
+    match_data.state = GTK_STATE_ACTIVE;
+
   if (!draw_simple_image (style, window, area, widget, &match_data, TRUE,
 			  x, y, width, height))
     parent_class->draw_option (style, window, state, shadow, area, widget, detail,
@@ -934,7 +950,7 @@
   match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
   match_data.shadow = shadow;
   match_data.state = state;
-  
+
   if (!draw_simple_image (style, window, area, widget, &match_data, TRUE,
 			  x, y, width, height))
     parent_class->draw_tab (style, window, state, shadow, area, widget, detail,


More information about the maemo-commits mailing list