[gtk+/gtk-style-context: 196/276] GtkButton: Notify on active state when (un)depressed
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-style-context: 196/276] GtkButton: Notify on active state when (un)depressed
- Date: Sat, 23 Oct 2010 19:11:36 +0000 (UTC)
commit 4bc0714b1fb8a9a8e4bea95c764689fafead4797
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 | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index ab3fe77..a395282 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -2217,6 +2217,18 @@ _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,
+ gtk_widget_get_window (widget),
+ 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]