magnifier: Adjust for removal of 'show-magnifier' key
gsettings-desktop-schemas had two conflicting settings for showing the magnifier: 'show-magnifier' in org.gnome.desktop.a11y.magnifier and 'screen-magnifier-enabled' in org.gnome.desktop.a11y.applications. The former has been removed in favor of the latter, so adjust to this change.
This commit is contained in:
parent
a1e019b41a
commit
3631983de5
@ -33,7 +33,10 @@ const MOUSE_POLL_FREQUENCY = 50;
|
|||||||
const CROSSHAIRS_CLIP_SIZE = [100, 100];
|
const CROSSHAIRS_CLIP_SIZE = [100, 100];
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
const SHOW_KEY = 'show-magnifier';
|
const APPLICATIONS_SCHEMA = 'org.gnome.desktop.a11y.applications';
|
||||||
|
const SHOW_KEY = 'screen-magnifier-enabled';
|
||||||
|
|
||||||
|
const MAGNIFIER_SCHEMA = 'org.gnome.desktop.a11y.magnifier';
|
||||||
const SCREEN_POSITION_KEY = 'screen-position';
|
const SCREEN_POSITION_KEY = 'screen-position';
|
||||||
const MAG_FACTOR_KEY = 'mag-factor';
|
const MAG_FACTOR_KEY = 'mag-factor';
|
||||||
const LENS_MODE_KEY = 'lens-mode';
|
const LENS_MODE_KEY = 'lens-mode';
|
||||||
@ -438,7 +441,8 @@ Magnifier.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_settingsInit: function(zoomRegion) {
|
_settingsInit: function(zoomRegion) {
|
||||||
this._settings = new Gio.Settings({ schema: 'org.gnome.desktop.a11y.magnifier' });
|
this._appSettings = new Gio.Settings({ schema: APPLICATIONS_SCHEMA });
|
||||||
|
this._settings = new Gio.Settings({ schema: MAGNIFIER_SCHEMA });
|
||||||
|
|
||||||
if (zoomRegion) {
|
if (zoomRegion) {
|
||||||
// Mag factor is accurate to two decimal places.
|
// Mag factor is accurate to two decimal places.
|
||||||
@ -462,9 +466,9 @@ Magnifier.prototype = {
|
|||||||
this.addCrosshairs();
|
this.addCrosshairs();
|
||||||
this.setCrosshairsVisible(showCrosshairs);
|
this.setCrosshairsVisible(showCrosshairs);
|
||||||
|
|
||||||
this._settings.connect('changed::' + SHOW_KEY,
|
this._appSettings.connect('changed::' + SHOW_KEY,
|
||||||
Lang.bind(this, function() {
|
Lang.bind(this, function() {
|
||||||
this.setActive(this._settings.get_boolean(SHOW_KEY));
|
this.setActive(this._appSettings.get_boolean(SHOW_KEY));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this._settings.connect('changed::' + SCREEN_POSITION_KEY,
|
this._settings.connect('changed::' + SCREEN_POSITION_KEY,
|
||||||
@ -508,7 +512,7 @@ Magnifier.prototype = {
|
|||||||
this.setCrosshairsClip(this._settings.get_boolean(CROSS_HAIRS_CLIP_KEY));
|
this.setCrosshairsClip(this._settings.get_boolean(CROSS_HAIRS_CLIP_KEY));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return this._settings.get_boolean(SHOW_KEY);
|
return this._appSettings.get_boolean(SHOW_KEY);
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateScreenPosition: function() {
|
_updateScreenPosition: function() {
|
||||||
|
@ -23,7 +23,7 @@ const KEY_BOUNCE_KEYS_ENABLED = 'bouncekeys-enable';
|
|||||||
const KEY_SLOW_KEYS_ENABLED = 'slowkeys-enable';
|
const KEY_SLOW_KEYS_ENABLED = 'slowkeys-enable';
|
||||||
const KEY_MOUSE_KEYS_ENABLED = 'mousekeys-enable';
|
const KEY_MOUSE_KEYS_ENABLED = 'mousekeys-enable';
|
||||||
|
|
||||||
const MAGNIFIER_SCHEMA = 'org.gnome.desktop.a11y.magnifier';
|
const APPLICATIONS_SCHEMA = 'org.gnome.desktop.a11y.applications';
|
||||||
const AT_SCREEN_KEYBOARD_SCHEMA = 'org.gnome.desktop.default-applications.at.mobility';
|
const AT_SCREEN_KEYBOARD_SCHEMA = 'org.gnome.desktop.default-applications.at.mobility';
|
||||||
const AT_SCREEN_READER_SCHEMA = 'org.gnome.desktop.default-applications.at.visual';
|
const AT_SCREEN_READER_SCHEMA = 'org.gnome.desktop.default-applications.at.visual';
|
||||||
|
|
||||||
@ -80,7 +80,8 @@ ATIndicator.prototype = {
|
|||||||
let highContrast = this._buildHCItem();
|
let highContrast = this._buildHCItem();
|
||||||
this.menu.addMenuItem(highContrast);
|
this.menu.addMenuItem(highContrast);
|
||||||
|
|
||||||
let magnifier = this._buildItem(_("Zoom"), MAGNIFIER_SCHEMA, 'show-magnifier');
|
let magnifier = this._buildItem(_("Zoom"), APPLICATIONS_SCHEMA,
|
||||||
|
'screen-magnifier-enabled');
|
||||||
this.menu.addMenuItem(magnifier);
|
this.menu.addMenuItem(magnifier);
|
||||||
|
|
||||||
let textZoom = this._buildFontItem();
|
let textZoom = this._buildFontItem();
|
||||||
|
Loading…
Reference in New Issue
Block a user