switch: propagate the active state to the slider
This commit is contained in:
@ -473,11 +473,15 @@ gtk_switch_paint_handle (GtkWidget *widget,
|
|||||||
cairo_t *cr,
|
cairo_t *cr,
|
||||||
GdkRectangle *box)
|
GdkRectangle *box)
|
||||||
{
|
{
|
||||||
|
GtkSwitchPrivate *priv = GTK_SWITCH (widget)->priv;
|
||||||
GtkStyleContext *context = gtk_widget_get_style_context (widget);
|
GtkStyleContext *context = gtk_widget_get_style_context (widget);
|
||||||
GtkStateFlags state;
|
GtkStateFlags state;
|
||||||
|
|
||||||
state = gtk_widget_get_state_flags (widget);
|
state = gtk_widget_get_state_flags (widget);
|
||||||
|
|
||||||
|
if (priv->is_active)
|
||||||
|
state |= GTK_STATE_FLAG_ACTIVE;
|
||||||
|
|
||||||
gtk_style_context_save (context);
|
gtk_style_context_save (context);
|
||||||
gtk_style_context_set_state (context, state);
|
gtk_style_context_set_state (context, state);
|
||||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SLIDER);
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SLIDER);
|
||||||
|
|||||||
Reference in New Issue
Block a user