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



commit 0cf614b0b0d8027028a270e762b7208725f018b0
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 d9d1047..16be0e9 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -2242,6 +2242,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]