cleanup: Port GObject classes to ES6 classes

GJS added API for defining GObject classes with ES6 class syntax
last cycle, use it to port the remaining Lang.Class classes to
the new syntax.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30
This commit is contained in:
Florian Müllner
2017-10-28 01:05:11 +02:00
parent 48399d46c0
commit acb44de469
5 changed files with 39 additions and 56 deletions
+3 -6
View File
@@ -16,13 +16,10 @@ function init() {
Convenience.initTranslations();
}
const ExamplePrefsWidget = new GObject.Class({
Name: 'Example.Prefs.Widget',
GTypeName: 'ExamplePrefsWidget',
Extends: Gtk.Grid,
const ExamplePrefsWidget = GObject.registerClass(
class ExamplePrefsWidget extends Gtk.Grid {
_init(params) {
this.parent(params);
super._init(params);
this.margin = 12;
this.row_spacing = this.column_spacing = 6;
this.set_orientation(Gtk.Orientation.VERTICAL);