mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
quickSettings: Set Atk checked state
Make sure that we update the accessibility state of a quick settings toggle button appropriately to its actual state, as a screen reader has no way of knowing otherwise whether it's actually checked or not. Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7048
This commit is contained in:
parent
b1a27d6086
commit
26f8bf1cad
1 changed files with 10 additions and 0 deletions
|
|
@ -128,6 +128,9 @@ export const QuickToggle = GObject.registerClass({
|
||||||
GObject.BindingFlags.SYNC_CREATE,
|
GObject.BindingFlags.SYNC_CREATE,
|
||||||
(bind, source) => [true, source !== null],
|
(bind, source) => [true, source !== null],
|
||||||
null);
|
null);
|
||||||
|
|
||||||
|
this.connect('notify::checked', () => this._updateAccessibleState());
|
||||||
|
this._updateAccessibleState();
|
||||||
}
|
}
|
||||||
|
|
||||||
get label() {
|
get label() {
|
||||||
|
|
@ -139,6 +142,13 @@ export const QuickToggle = GObject.registerClass({
|
||||||
console.warn('Trying to set label on QuickToggle. Use title instead.');
|
console.warn('Trying to set label on QuickToggle. Use title instead.');
|
||||||
this.title = label;
|
this.title = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_updateAccessibleState() {
|
||||||
|
if (this.checked)
|
||||||
|
this.add_accessible_state(Atk.StateType.CHECKED);
|
||||||
|
else
|
||||||
|
this.remove_accessible_state(Atk.StateType.CHECKED);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export const QuickMenuToggle = GObject.registerClass({
|
export const QuickMenuToggle = GObject.registerClass({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue