[gtk+/gtk-2-24] Revert "entry: never use GTK_STATE_ACTIVE to paint the background"



commit 3087e8b74eaf6f12eefb8a40bbcde857509a10ac
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Mar 5 17:42:28 2013 -0500

    Revert "entry: never use GTK_STATE_ACTIVE to paint the background"
    
    This reverts commit 87115e00a81e9d6a2c4d18106af422765004fe2a.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=695003

 gtk/gtkentry.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index aaeb87c..2c9c5a4 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3445,7 +3445,12 @@ gtk_entry_expose (GtkWidget      *widget,
   GtkStateType state;
   GtkEntryPrivate *priv = GTK_ENTRY_GET_PRIVATE (entry);
 
-  state = gtk_widget_get_state (widget);
+  gtk_widget_style_get (widget, "state-hint", &state_hint, NULL);
+  if (state_hint)
+    state = gtk_widget_has_focus (widget) ?
+      GTK_STATE_ACTIVE : gtk_widget_get_state (widget);
+  else
+    state = gtk_widget_get_state(widget);
 
   if (widget->window == event->window)
     {
@@ -3492,7 +3497,7 @@ gtk_entry_expose (GtkWidget      *widget,
               height = gdk_window_get_height (icon_info->window);
 
               gtk_paint_flat_box (widget->style, icon_info->window,
-                                  state, GTK_SHADOW_NONE,
+                                  gtk_widget_get_state (widget), GTK_SHADOW_NONE,
                                   NULL, widget, "entry_bg",
                                   0, 0, width, height);
 


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