switch: propagate the active state to the slider

This commit is contained in:
Cosimo Cecchi 2011-02-28 18:46:46 -05:00
parent 0ff4fdb233
commit c310c35a7a

View File

@ -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);