[gtk+/gtk-style-context] GtkButton: Notify on active state when (un)depressed



commit fffc716d7c2d21e74f13b33399fcbbd458f5464e
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Aug 19 22:47:44 2010 +0200

    GtkButton: Notify on active state when (un)depressed

 gtk/gtkbutton.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 37367b3..5509b19 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -2125,6 +2125,17 @@ _gtk_button_set_depressed (GtkButton *button,
 
   if (depressed != button->depressed)
     {
+      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, widget->window,
+                                                 NULL, GTK_STATE_ACTIVE,
+                                                 depressed);
+        }
+
       button->depressed = depressed;
       gtk_widget_queue_resize (widget);
     }



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