remoteMenu: Add support for extended accessibility roles
https://bugzilla.gnome.org/show_bug.cgi?id=700257
This commit is contained in:
parent
419f2dca15
commit
3075f3cfe4
@ -1,5 +1,6 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
|
const Atk = imports.gi.Atk;
|
||||||
const GLib = imports.gi.GLib;
|
const GLib = imports.gi.GLib;
|
||||||
const GObject = imports.gi.GObject;
|
const GObject = imports.gi.GObject;
|
||||||
const Gio = imports.gi.Gio;
|
const Gio = imports.gi.Gio;
|
||||||
@ -29,12 +30,12 @@ const RemoteMenuItemMapper = new Lang.Class({
|
|||||||
|
|
||||||
this._trackerItem.connect('notify::label', Lang.bind(this, this._updateLabel));
|
this._trackerItem.connect('notify::label', Lang.bind(this, this._updateLabel));
|
||||||
this._trackerItem.connect('notify::sensitive', Lang.bind(this, this._updateSensitivity));
|
this._trackerItem.connect('notify::sensitive', Lang.bind(this, this._updateSensitivity));
|
||||||
this._trackerItem.connect('notify::role', Lang.bind(this, this._updateDecoration));
|
this._trackerItem.connect('notify::role', Lang.bind(this, this._updateRole));
|
||||||
this._trackerItem.connect('notify::toggled', Lang.bind(this, this._updateDecoration));
|
this._trackerItem.connect('notify::toggled', Lang.bind(this, this._updateDecoration));
|
||||||
|
|
||||||
this._updateLabel();
|
this._updateLabel();
|
||||||
this._updateSensitivity();
|
this._updateSensitivity();
|
||||||
this._updateDecoration();
|
this._updateRole();
|
||||||
|
|
||||||
this.menuItem.connect('destroy', function() {
|
this.menuItem.connect('destroy', function() {
|
||||||
trackerItem.run_dispose();
|
trackerItem.run_dispose();
|
||||||
@ -63,6 +64,18 @@ const RemoteMenuItemMapper = new Lang.Class({
|
|||||||
|
|
||||||
this.menuItem.setOrnament(ornament);
|
this.menuItem.setOrnament(ornament);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_updateRole: function() {
|
||||||
|
let a11yRoles = {};
|
||||||
|
a11yRoles[ShellMenu.MenuTrackerItemRole.NORMAL] = Atk.Role.MENU_ITEM;
|
||||||
|
a11yRoles[ShellMenu.MenuTrackerItemRole.RADIO] = Atk.Role.RADIO_MENU_ITEM;
|
||||||
|
a11yRoles[ShellMenu.MenuTrackerItemRole.CHECK] = Atk.Role.CHECK_MENU_ITEM;
|
||||||
|
|
||||||
|
let a11yRole = a11yRoles[this._trackerItem.role];
|
||||||
|
this.menuItem.actor.accessible_role = a11yRole;
|
||||||
|
|
||||||
|
this._updateDecoration();
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const RemoteMenu = new Lang.Class({
|
const RemoteMenu = new Lang.Class({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user