status/backlight: Sync checked on level changes

Since switching to property bindings/notifications, value changes
only happen on actual changes, so we cannot rely on them as the sole
source of updating the checked state.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2862>
This commit is contained in:
Florian Müllner 2023-08-05 21:12:55 +02:00 committed by Marge Bot
parent 987435f1cc
commit 910829f270

View File

@ -127,6 +127,7 @@ const DiscreteItem = GObject.registerClass({
this._levelButtons.get('off').visible = this.nLevels > 0;
this._levelButtons.get('high').visible = this.nLevels > 1;
this._levelButtons.get('low').visible = this.nLevels > 2;
this._syncChecked();
}
_syncChecked() {