From e2e198aae4b6f524c30e8215d44fa7507171b36b Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 31 Oct 2015 00:08:00 -0400 Subject: [PATCH] model button: Propagate state Propagate the state to the CSS node for the indicator. --- gtk/gtkmodelbutton.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c index 88a32aa0a4..d3c791647d 100644 --- a/gtk/gtkmodelbutton.c +++ b/gtk/gtkmodelbutton.c @@ -158,10 +158,15 @@ gtk_model_button_update_state (GtkModelButton *button) if (button->active && !button->menu_name) state |= GTK_STATE_FLAG_CHECKED; - gtk_widget_set_state_flags (GTK_WIDGET (button), state, TRUE); gtk_css_node_set_state (button->indicator_node, state); } +static void +gtk_model_button_state_flags_changed (GtkWidget *widget, + GtkStateFlags previous_flags) +{ + gtk_model_button_update_state (GTK_MODEL_BUTTON (widget)); +} static void gtk_model_button_set_role (GtkModelButton *button, @@ -857,6 +862,7 @@ gtk_model_button_class_init (GtkModelButtonClass *class) widget_class->size_allocate = gtk_model_button_size_allocate; widget_class->draw = gtk_model_button_draw; widget_class->destroy = gtk_model_button_destroy; + widget_class->state_flags_changed = gtk_model_button_state_flags_changed; button_class->clicked = gtk_model_button_clicked;