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

@ -488,16 +488,14 @@ var ActivitiesButton = new Lang.Class({
}
});
var PanelCorner = new Lang.Class({
Name: 'PanelCorner',
_init(side) {
var PanelCorner = class {
constructor(side) {
this._side = side;
this.actor = new St.DrawingArea({ style_class: 'panel-corner' });
this.actor.connect('style-changed', this._styleChanged.bind(this));
this.actor.connect('repaint', this._repaint.bind(this));
},
}
_findRightmostButton(container) {
if (!container.get_children)
@ -522,7 +520,7 @@ var PanelCorner = new Lang.Class({
return this._findRightmostButton(children[index]);
return children[index];
},
}
_findLeftmostButton(container) {
if (!container.get_children)
@ -547,7 +545,7 @@ var PanelCorner = new Lang.Class({
return this._findLeftmostButton(children[index]);
return children[index];
},
}
setStyleParent(box) {
let side = this._side;
@ -593,7 +591,7 @@ var PanelCorner = new Lang.Class({
// the .panel-button default
button.style = 'transition-duration: 0ms';
}
},
}
_repaint() {
let node = this.actor.get_theme_node();
@ -641,7 +639,7 @@ var PanelCorner = new Lang.Class({
}
cr.$dispose();
},
}
_styleChanged() {
let node = this.actor.get_theme_node();
@ -652,7 +650,7 @@ var PanelCorner = new Lang.Class({
this.actor.set_size(cornerRadius, borderWidth + cornerRadius);
this.actor.set_anchor_point(0, borderWidth);
}
});
};
var AggregateLayout = new Lang.Class({
Name: 'AggregateLayout',