[gtk+] GtkButton: Notify on prelight state change.



commit 5b11d14a49c2d900f2fabf193742cee09f81bd52
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Oct 5 10:56:52 2010 +0200

    GtkButton: Notify on prelight state change.

 gtk/gtkbutton.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index beece34..9b71c29 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -1746,6 +1746,18 @@ gtk_button_enter_notify (GtkWidget        *widget,
     {
       priv->in_button = TRUE;
       gtk_button_enter (button);
+
+      if (gtk_widget_get_realized (widget) &&
+          gtk_widget_is_drawable (widget))
+        {
+          GtkStyleContext *context;
+
+          context = gtk_widget_get_style_context (widget);
+          gtk_style_context_notify_state_change (context,
+                                                 gtk_widget_get_window (widget),
+                                                 NULL, GTK_STATE_PRELIGHT,
+                                                 button->in_button);
+        }
     }
 
   return FALSE;
@@ -1764,6 +1776,18 @@ gtk_button_leave_notify (GtkWidget        *widget,
     {
       priv->in_button = FALSE;
       gtk_button_leave (button);
+
+      if (gtk_widget_get_realized (widget) &&
+          gtk_widget_is_drawable (widget))
+        {
+          GtkStyleContext *context;
+
+          context = gtk_widget_get_style_context (widget);
+          gtk_style_context_notify_state_change (context,
+                                                 gtk_widget_get_window (widget),
+                                                 NULL, GTK_STATE_PRELIGHT,
+                                                 button->in_button);
+        }
     }
 
   return FALSE;



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