Use constructor in GObject classes

This commit is contained in:
Romain Vigier
2022-02-18 13:24:25 +01:00
parent a407981ce5
commit 2faad1e9af
5 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -194,8 +194,8 @@ Signals.addSignalMethods(TimerOndemand.prototype);
var NtsPanelMenuButton = GObject.registerClass(
class NtsPanelMenuButton extends PanelMenuButton {
_init() {
super._init(0.0);
constructor() {
super(0.0);
this.icon = new St.Icon({
style_class: 'system-status-icon',
});
@@ -213,8 +213,8 @@ var NtsPanelMenuButton = GObject.registerClass(
var NtsPopupMenuItem = GObject.registerClass(
class NtsPopupMenuItem extends PopupBaseMenuItem {
_init(params) {
super._init(params);
constructor(params) {
super(params);
this.icon = new St.Icon({
style_class: 'popup-menu-icon',
x_align: Clutter.ActorAlign.END,
+2 -2
View File
@@ -15,8 +15,8 @@ var BackgroundsPage = GObject.registerClass({
'night_button',
],
}, class BackgroundsPage extends Adw.PreferencesPage {
_init(props = {}) {
super._init(props);
constructor(props = {}) {
super(props);
const settings = new Gio.Settings({ schema: 'org.gnome.desktop.background' });
settings.bind('picture-uri', this._day_button, 'path', Gio.SettingsBindFlags.DEFAULT);
+2 -2
View File
@@ -18,8 +18,8 @@ var CommandsPage = GObject.registerClass({
'sunset_entry',
],
}, class CommandsPage extends Adw.PreferencesPage {
_init(props = {}) {
super._init(props);
constructor(props = {}) {
super(props);
const settings = extensionUtils.getSettings(utils.getSettingsSchema('commands'));
settings.bind('enabled', this._enabled_switch, 'active', Gio.SettingsBindFlags.DEFAULT);
+2 -2
View File
@@ -29,8 +29,8 @@ var SchedulePage = GObject.registerClass({
'ondemand_preferences_group',
],
}, class SchedulePage extends Adw.PreferencesPage {
_init(props = {}) {
super._init(props);
constructor(props = {}) {
super(props);
const settings = extensionUtils.getSettings(utils.getSettingsSchema('time'));
const colorSettings = new Gio.Settings({ schema: 'org.gnome.settings-daemon.plugins.color' });
const locationSettings = new Gio.Settings({ schema: 'org.gnome.system.location' });
+2 -2
View File
@@ -30,8 +30,8 @@ var ThemesPage = GObject.registerClass({
'cursor_night_variant_combo_row',
],
}, class ThemesPage extends Adw.PreferencesPage {
_init(props = {}) {
super._init(props);
constructor(props = {}) {
super(props);
const gtkSettings = extensionUtils.getSettings(utils.getSettingsSchema('gtk-variants'));
const shellSettings = extensionUtils.getSettings(utils.getSettingsSchema('shell-variants'));
const iconSettings = extensionUtils.getSettings(utils.getSettingsSchema('icon-variants'));