expander: Use the widget state flags as a base for drawing
This commit is contained in:
@ -887,26 +887,28 @@ gtk_expander_paint (GtkExpander *expander,
|
|||||||
|
|
||||||
widget = GTK_WIDGET (expander);
|
widget = GTK_WIDGET (expander);
|
||||||
context = gtk_widget_get_style_context (widget);
|
context = gtk_widget_get_style_context (widget);
|
||||||
|
state = gtk_widget_get_state_flags (widget);
|
||||||
|
|
||||||
get_expander_bounds (expander, &clip);
|
get_expander_bounds (expander, &clip);
|
||||||
gtk_widget_get_allocation (widget, &allocation);
|
gtk_widget_get_allocation (widget, &allocation);
|
||||||
|
|
||||||
gtk_style_context_save (context);
|
gtk_style_context_save (context);
|
||||||
|
|
||||||
|
state &= ~(GTK_STATE_FLAG_PRELIGHT);
|
||||||
if (expander->priv->prelight)
|
if (expander->priv->prelight)
|
||||||
{
|
{
|
||||||
state = GTK_STATE_FLAG_PRELIGHT;
|
state |= GTK_STATE_FLAG_PRELIGHT;
|
||||||
gtk_style_context_set_state (context, state);
|
gtk_style_context_set_state (context, state);
|
||||||
gtk_expander_paint_prelight (expander, cr);
|
gtk_expander_paint_prelight (expander, cr);
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_style_get (widget, "expander-size", &size, NULL);
|
gtk_widget_style_get (widget, "expander-size", &size, NULL);
|
||||||
|
|
||||||
state = gtk_style_context_get_state (context);
|
|
||||||
|
|
||||||
/* Set active flag as per the expanded state */
|
/* Set active flag as per the expanded state */
|
||||||
if (priv->expanded)
|
if (priv->expanded)
|
||||||
state |= GTK_STATE_FLAG_ACTIVE;
|
state |= GTK_STATE_FLAG_ACTIVE;
|
||||||
|
else
|
||||||
|
state &= ~(GTK_STATE_FLAG_ACTIVE);
|
||||||
|
|
||||||
gtk_style_context_set_state (context, state);
|
gtk_style_context_set_state (context, state);
|
||||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_EXPANDER);
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_EXPANDER);
|
||||||
|
|||||||
Reference in New Issue
Block a user