summaryrefslogtreecommitdiff
path: root/gtk/gtkcheckbutton.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-05-25 20:29:06 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-05-25 20:29:06 +0000
commitee80a22db4c619a69bf8b16dfe2e26094d5028ae (patch)
tree870367fa147814343a4949345d7f0ff046e9292f /gtk/gtkcheckbutton.c
parentd32c34365797f76d9fba5ddde932022c5f041f6d (diff)
parentbad01edd2c625910c25cac563c903f7f5f31bb39 (diff)
downloadgtk+-ee80a22db4c619a69bf8b16dfe2e26094d5028ae.tar.gz
Merge branch 'wip/exalm/checks' into 'master'
checkbutton: Sync the indicator state with the widget See merge request GNOME/gtk!3568
Diffstat (limited to 'gtk/gtkcheckbutton.c')
-rw-r--r--gtk/gtkcheckbutton.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c
index e59a9abe99..0ed5bf8dd3 100644
--- a/gtk/gtkcheckbutton.c
+++ b/gtk/gtkcheckbutton.c
@@ -399,6 +399,19 @@ get_group_active_button (GtkCheckButton *self)
return NULL;
}
+static void
+gtk_check_button_state_flags_changed (GtkWidget *widget,
+ GtkStateFlags previous_flags)
+{
+ GtkCheckButton *self = GTK_CHECK_BUTTON (widget);
+ GtkCheckButtonPrivate *priv = gtk_check_button_get_instance_private (self);
+ GtkStateFlags state = gtk_widget_get_state_flags (GTK_WIDGET (self));
+
+ gtk_widget_set_state_flags (priv->indicator_widget, state, TRUE);
+
+ GTK_WIDGET_CLASS (gtk_check_button_parent_class)->state_flags_changed (widget, previous_flags);
+}
+
static gboolean
gtk_check_button_focus (GtkWidget *widget,
GtkDirectionType direction)
@@ -503,6 +516,7 @@ gtk_check_button_class_init (GtkCheckButtonClass *class)
object_class->set_property = gtk_check_button_set_property;
object_class->get_property = gtk_check_button_get_property;
+ widget_class->state_flags_changed = gtk_check_button_state_flags_changed;
widget_class->focus = gtk_check_button_focus;
class->activate = gtk_check_button_real_activate;