[gnumeric] gtk+: GTK_WIDGET_STATE



commit 9303a1624c83461a06eed2b891a2e822269bc2da
Author: Morten Welinder <terra gnome org>
Date:   Fri May 28 08:58:52 2010 -0400

    gtk+: GTK_WIDGET_STATE

 NEWS                                      |    1 +
 configure.in                              |    2 +-
 src/widgets/ChangeLog                     |    5 +++++
 src/widgets/gnumeric-cell-renderer-text.c |   13 +++++++------
 4 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/NEWS b/NEWS
index 9f4c2d0..531b429 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Morten:
 	* Fix stf crash.  [#619283]
 	* Persist solver model type.
 	* Add non-linear solver.
+	* Feed the gtk+ deprecation monster.  [#572240]
 
 Sameer Morar:
 	* Improve page setup dialog. [#619421]
diff --git a/configure.in b/configure.in
index 367d3ae..ca5cdc0 100644
--- a/configure.in
+++ b/configure.in
@@ -689,7 +689,7 @@ LIBS="$GNUMERIC_LIBS $LIBS"
 
 AC_CHECK_FUNCS(g_date_set_time_t g_slice_alloc g_option_context_set_delocalize)
 AC_CHECK_FUNCS(pango_font_map_create_context)
-AC_CHECK_FUNCS(gtk_orientable_set_orientation gtk_adjustment_configure gtk_widget_get_window gsf_open_pkg_foreach_rel gtk_dialog_get_content_area gtk_entry_get_buffer gtk_widget_get_can_focus)
+AC_CHECK_FUNCS(gtk_orientable_set_orientation gtk_adjustment_configure gtk_widget_get_state gtk_widget_get_window gsf_open_pkg_foreach_rel gtk_dialog_get_content_area gtk_entry_get_buffer gtk_widget_get_can_focus)
 AC_CHECK_FUNCS(gsf_infile_msvba_steal_modules)
 
 AC_MSG_CHECKING([for PANGO_WEIGHT_THIN etc.])
diff --git a/src/widgets/ChangeLog b/src/widgets/ChangeLog
index 4e1936e..5f93422 100644
--- a/src/widgets/ChangeLog
+++ b/src/widgets/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-28  Morten Welinder  <terra gnome org>
+
+	* gnumeric-cell-renderer-text.c (gnumeric_cell_renderer_text_render):
+	Use gtk_widget_get_state, if present.
+
 2010-05-20  Morten Welinder <terra gnome org>
 
 	* Release 1.10.4
diff --git a/src/widgets/gnumeric-cell-renderer-text.c b/src/widgets/gnumeric-cell-renderer-text.c
index e323bdc..00692e2 100644
--- a/src/widgets/gnumeric-cell-renderer-text.c
+++ b/src/widgets/gnumeric-cell-renderer-text.c
@@ -19,6 +19,10 @@
 #include <gnumeric-config.h>
 #include "gnumeric-cell-renderer-text.h"
 
+#ifndef HAVE_GTK_WIDGET_GET_STATE
+#define gtk_widget_get_state(_w) GTK_WIDGET_STATE((_w))
+#endif
+
 static void gnumeric_cell_renderer_text_class_init
     (GnumericCellRendererTextClass *cell_text_class);
 
@@ -64,16 +68,13 @@ gnumeric_cell_renderer_text_render (GtkCellRenderer     *cell,
 	GtkStateType state;
 	GdkGC *gc = gdk_gc_new (window);
 
-	if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED)
-	{
+	if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED)	{
 		if (GTK_WIDGET_HAS_FOCUS (widget))
 			state = GTK_STATE_SELECTED;
 		else
 			state = GTK_STATE_ACTIVE;
-	}
-	else
-	{
-		if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)
+	} else {
+		if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE)
 			state = GTK_STATE_INSENSITIVE;
 		else
 			state = GTK_STATE_NORMAL;



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