cleanup: Port non-GObject classes to JS6 classes

ES6 finally adds standard class syntax to the language, so we can
replace our custom Lang.Class framework with the new syntax. Any
classes that inherit from GObject will need special treatment,
so limit the port to regular javascript classes for now.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/361
This commit is contained in:
Florian Müllner
2017-10-31 02:19:44 +01:00
committed by Georges Basile Stavracas Neto
parent 99ce3deeb0
commit bacfdbbb03
102 changed files with 3454 additions and 4183 deletions

View File

@ -210,19 +210,17 @@ var Button = new Lang.Class({
* of an icon and a menu section, which will be composed into the
* aggregate menu.
*/
var SystemIndicator = new Lang.Class({
Name: 'SystemIndicator',
_init() {
var SystemIndicator = class {
constructor() {
this.indicators = new St.BoxLayout({ style_class: 'panel-status-indicators-box',
reactive: true });
this.indicators.hide();
this.menu = new PopupMenu.PopupMenuSection();
},
}
_syncIndicatorsVisible() {
this.indicators.visible = this.indicators.get_children().some(a => a.visible);
},
}
_addIndicator() {
let icon = new St.Icon({ style_class: 'system-status-icon' });
@ -231,5 +229,5 @@ var SystemIndicator = new Lang.Class({
this._syncIndicatorsVisible();
return icon;
}
});
};
Signals.addSignalMethods(SystemIndicator.prototype);