Revert "KeyboardStatus: handle modifier key indicators"
The 'show-keyboard-leds-indicator' key has been removed from
the schema.
This reverts commit 20f49e8c89
.
This commit is contained in:
parent
bc6be40fdd
commit
0244c6d5b8
@ -43,10 +43,6 @@ const STANDARD_TRAY_ICON_SHELL_IMPLEMENTATION = {
|
||||
if (Config.HAVE_BLUETOOTH)
|
||||
STANDARD_TRAY_ICON_SHELL_IMPLEMENTATION['bluetooth'] = imports.ui.status.bluetooth.Indicator;
|
||||
|
||||
const STANDARD_TRAY_INDICATOR_FACTORIES = [
|
||||
imports.ui.status.keyboard.ModifierIndicatorFactory
|
||||
];
|
||||
|
||||
// in org.gnome.desktop.interface
|
||||
const CLOCK_FORMAT_KEY = 'clock-format';
|
||||
|
||||
@ -813,16 +809,13 @@ Panel.prototype = {
|
||||
|
||||
/* right */
|
||||
|
||||
// On-off indicators (for keyboard leds and accessx) are in indicatorBox
|
||||
// System status applets live in statusBox, and legacy tray icons
|
||||
// System status applets live in statusBox, while legacy tray icons
|
||||
// live in trayBox
|
||||
// The trayBox is hidden when there are no tray icons.
|
||||
this._indicatorBox = new St.BoxLayout({ name: 'indicatorBox' });
|
||||
this._trayBox = new St.BoxLayout({ name: 'legacyTray' });
|
||||
this._statusBox = new St.BoxLayout({ name: 'statusTray' });
|
||||
|
||||
this._trayBox.hide();
|
||||
this._rightBox.add(this._indicatorBox);
|
||||
this._rightBox.add(this._trayBox);
|
||||
this._rightBox.add(this._statusBox);
|
||||
|
||||
@ -874,13 +867,6 @@ Panel.prototype = {
|
||||
},
|
||||
|
||||
startStatusArea: function() {
|
||||
for (let i = 0; i < STANDARD_TRAY_INDICATOR_FACTORIES.length; i++) {
|
||||
let factory = new STANDARD_TRAY_INDICATOR_FACTORIES[i];
|
||||
let indicators = factory.getIndicators();
|
||||
for (let j = 0; j < indicators.length; j++)
|
||||
this._indicatorBox.add(indicators[j]);
|
||||
}
|
||||
|
||||
for (let i = 0; i < STANDARD_TRAY_ICON_ORDER.length; i++) {
|
||||
let role = STANDARD_TRAY_ICON_ORDER[i];
|
||||
let constructor = STANDARD_TRAY_ICON_SHELL_IMPLEMENTATION[role];
|
||||
|
@ -204,52 +204,3 @@ XKBIndicator.prototype = {
|
||||
this._labelActors[i].allocate_align_fill(box, 0.5, 0, false, false, flags);
|
||||
}
|
||||
};
|
||||
|
||||
function ModifierIndicatorFactory() {
|
||||
this._init.call(this);
|
||||
}
|
||||
|
||||
ModifierIndicatorFactory.prototype = {
|
||||
_init: function() {
|
||||
this._settings = new Gio.Settings({ schema: INDICATOR_SCHEMA });
|
||||
this._settings.connect('changed::show-keyboard-leds-indicator', Lang.bind(this, this._changed));
|
||||
|
||||
this._config = Gkbd.Configuration.get();
|
||||
this._config.connect('indicators-changed', Lang.bind(this, this._changed));
|
||||
|
||||
this._scrollLock = new St.Icon({ icon_name: 'kbdled-scroll-lock', icon_type: St.IconType.SYMBOLIC, style_class: 'system-status-icon' });
|
||||
this._numLock = new St.Icon({ icon_name: 'kbdled-num-lock', icon_type: St.IconType.SYMBOLIC, style_class: 'system-status-icon' });
|
||||
this._capsLock = new St.Icon({ icon_name: 'kbdled-caps-lock', icon_type: St.IconType.SYMBOLIC, style_class: 'system-status-icon' });
|
||||
|
||||
this._changed();
|
||||
},
|
||||
|
||||
getIndicators: function() {
|
||||
return [this._scrollLock, this._numLock, this._capsLock];
|
||||
},
|
||||
|
||||
_changed: function() {
|
||||
let enable = this._settings.get_boolean('show-keyboard-leds-indicator');
|
||||
|
||||
if (enable) {
|
||||
if (this._config.get_scroll_lock_state())
|
||||
this._scrollLock.show();
|
||||
else
|
||||
this._scrollLock.hide();
|
||||
|
||||
if (this._config.get_num_lock_state())
|
||||
this._numLock.show();
|
||||
else
|
||||
this._numLock.hide();
|
||||
|
||||
if (this._config.get_caps_lock_state())
|
||||
this._capsLock.show();
|
||||
else
|
||||
this._capsLock.hide();
|
||||
} else {
|
||||
this._scrollLock.hide();
|
||||
this._numLock.hide();
|
||||
this._capsLock.hide();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user