[gtk+/gtk-style-context: 196/251] 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/251] GtkButton: Notify on active state when (un)depressed
- Date: Tue, 12 Oct 2010 02:11:35 +0000 (UTC)
commit 634911ff7e5d06867c1a83e68f7c2fb941915944
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 b862ebf..2c06725 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -2234,6 +2234,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]