summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2011-02-28 18:46:46 -0500
committerCosimo Cecchi <cosimoc@gnome.org>2011-03-03 17:48:25 -0500
commitc310c35a7a87307c1534a932f43f9255d26faa9b (patch)
treebb98d65a4d1bb95fd622a924479e575c2e459ac1
parent0ff4fdb2335a27f72c482eaa0e69879430b500b7 (diff)
downloadgtk+-c310c35a7a87307c1534a932f43f9255d26faa9b.tar.gz
switch: propagate the active state to the slider
-rw-r--r--gtk/gtkswitch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c
index d69534c1ed..1a8e42762d 100644
--- a/gtk/gtkswitch.c
+++ b/gtk/gtkswitch.c
@@ -473,11 +473,15 @@ gtk_switch_paint_handle (GtkWidget *widget,
cairo_t *cr,
GdkRectangle *box)
{
+ GtkSwitchPrivate *priv = GTK_SWITCH (widget)->priv;
GtkStyleContext *context = gtk_widget_get_style_context (widget);
GtkStateFlags state;
state = gtk_widget_get_state_flags (widget);
+ if (priv->is_active)
+ state |= GTK_STATE_FLAG_ACTIVE;
+
gtk_style_context_save (context);
gtk_style_context_set_state (context, state);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SLIDER);