diff options
author | Matthias Clasen <mclasen@redhat.com> | 2023-01-24 16:08:57 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2023-01-24 16:08:57 +0000 |
commit | 7e392a1186634a259c34d610cbfccb1596650edb (patch) | |
tree | 791454b9cc05219c3c7007dfe0a1e43ec57bc83a | |
parent | 5caa66ffb70506efdb929d16fc4e12537435d0d7 (diff) | |
parent | 53d87e42a56f96c64589bc48772f5fcfd89a30c4 (diff) | |
download | gtk+-7e392a1186634a259c34d610cbfccb1596650edb.tar.gz |
Merge branch 'wip/abono/gtk-switch-state-off' into 'main'
gtkswitch: Allow to set state FALSE while keeping active TRUE
See merge request GNOME/gtk!5442
-rw-r--r-- | gtk/gtkswitch.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c index e59f933617..062e7ea960 100644 --- a/gtk/gtkswitch.c +++ b/gtk/gtkswitch.c @@ -742,9 +742,8 @@ gtk_switch_get_active (GtkSwitch *self) * * Sets the underlying state of the `GtkSwitch`. * - * Normally, this is the same as [property@Gtk.Switch:active], unless - * the switch is set up for delayed state changes. This function is - * typically called from a [signal@Gtk.Switch::state-set] signal handler. + * This function is typically called from a [signal@Gtk.Switch::state-set] + * signal handler in order to set up delayed state changes. * * See [signal@Gtk.Switch::state-set] for details. */ @@ -761,12 +760,6 @@ gtk_switch_set_state (GtkSwitch *self, self->state = state; - /* This will be a no-op if we're switching the state in response - * to a UI change. We're setting active anyway, to catch 'spontaneous' - * state changes. - */ - gtk_switch_set_active (self, state); - if (state) gtk_widget_set_state_flags (GTK_WIDGET (self), GTK_STATE_FLAG_CHECKED, FALSE); else |