You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When binding to `state` the `Switch` can be in a wrong position where it is colored to be active, but the slider is at the wrong spot. As per advice in the GTK-chat, one should instead bind to the active-property.
The `Switch` now retains its state even after closing the application.
78
78
But we can make this even better.
79
-
The `Switch` has a property "state" and `Settings` allows us to bind properties to a specific setting.
79
+
The `Switch` has a property "active" and `Settings` allows us to bind properties to a specific setting.
80
80
So let's do exactly that.
81
81
82
82
We can remove the [`boolean`](https://gtk-rs.org/gtk-rs-core/stable/latest/docs/gio/prelude/trait.SettingsExt.html#tymethod.boolean) call before initializing the `Switch` as well as the [`connect_state_set`](../docs/gtk4/struct.Switch.html#method.connect_state_set) call.
0 commit comments