diff --git a/src/extensionModules/BoxOrderManager.js b/src/extensionModules/BoxOrderManager.js index adf8d1b..0525d08 100644 --- a/src/extensionModules/BoxOrderManager.js +++ b/src/extensionModules/BoxOrderManager.js @@ -10,11 +10,15 @@ import * as Main from "resource:///org/gnome/shell/ui/main.js"; * what is really useable by the other extension code. * It's basically a heavy wrapper around the box orders stored in the settings. */ -const BoxOrderManager = GObject.registerClass({ - Signals: { - "appIndicatorReady": {} +export default class BoxOrderManager extends GObject.Object { + static { + GObject.registerClass({ + Signals: { + "appIndicatorReady": {} + } + }, this); } -}, class BoxOrderManager extends GObject.Object { + #appIndicatorReadyHandlerIdMap; #appIndicatorItemApplicationRoleMap; #settings; @@ -267,6 +271,4 @@ const BoxOrderManager = GObject.registerClass({ saveBoxOrderToSettings(boxOrders.center, "center"); saveBoxOrderToSettings(boxOrders.right, "right"); } -}); - -export default BoxOrderManager; +} diff --git a/src/prefsModules/PrefsBoxOrderListBox.js b/src/prefsModules/PrefsBoxOrderListBox.js index 5c08922..444745e 100644 --- a/src/prefsModules/PrefsBoxOrderListBox.js +++ b/src/prefsModules/PrefsBoxOrderListBox.js @@ -9,24 +9,28 @@ import { ExtensionPreferences } from "resource:///org/gnome/Shell/Extensions/js/ import PrefsBoxOrderItemRow from "./PrefsBoxOrderItemRow.js"; import PrefsBoxOrderListEmptyPlaceholder from "./PrefsBoxOrderListEmptyPlaceholder.js"; -const PrefsBoxOrderListBox = GObject.registerClass({ - GTypeName: "PrefsBoxOrderListBox", - Template: GLib.uri_resolve_relative(import.meta.url, "../ui/prefs-box-order-list-box.ui", GLib.UriFlags.NONE), - Properties: { - BoxOrder: GObject.ParamSpec.string( - "box-order", - "Box Order", - "The box order this PrefsBoxOrderListBox is associated with.", - GObject.ParamFlags.READWRITE, - "" - ) - }, - Signals: { - "row-move": { - param_types: [PrefsBoxOrderItemRow, GObject.TYPE_STRING] - } +export default class PrefsBoxOrderListBox extends Gtk.ListBox { + static { + GObject.registerClass({ + GTypeName: "PrefsBoxOrderListBox", + Template: GLib.uri_resolve_relative(import.meta.url, "../ui/prefs-box-order-list-box.ui", GLib.UriFlags.NONE), + Properties: { + BoxOrder: GObject.ParamSpec.string( + "box-order", + "Box Order", + "The box order this PrefsBoxOrderListBox is associated with.", + GObject.ParamFlags.READWRITE, + "" + ) + }, + Signals: { + "row-move": { + param_types: [PrefsBoxOrderItemRow, GObject.TYPE_STRING] + } + } + }, this); } -}, class PrefsBoxOrderListBox extends Gtk.ListBox { + #settings; #rowSignalHandlerIds = new Map(); @@ -143,6 +147,4 @@ const PrefsBoxOrderListBox = GObject.registerClass({ } } } -}); - -export default PrefsBoxOrderListBox; +} diff --git a/src/prefsModules/PrefsBoxOrderListEmptyPlaceholder.js b/src/prefsModules/PrefsBoxOrderListEmptyPlaceholder.js index b04d256..8dd772b 100644 --- a/src/prefsModules/PrefsBoxOrderListEmptyPlaceholder.js +++ b/src/prefsModules/PrefsBoxOrderListEmptyPlaceholder.js @@ -4,10 +4,14 @@ import Gtk from "gi://Gtk"; import GObject from "gi://GObject"; import GLib from "gi://GLib"; -const PrefsBoxOrderListEmptyPlaceholder = GObject.registerClass({ - GTypeName: "PrefsBoxOrderListEmptyPlaceholder", - Template: GLib.uri_resolve_relative(import.meta.url, "../ui/prefs-box-order-list-empty-placeholder.ui", GLib.UriFlags.NONE) -}, class PrefsBoxOrderListEmptyPlaceholder extends Gtk.Box { +export default class PrefsBoxOrderListEmptyPlaceholder extends Gtk.Box { + static { + GObject.registerClass({ + GTypeName: "PrefsBoxOrderListEmptyPlaceholder", + Template: GLib.uri_resolve_relative(import.meta.url, "../ui/prefs-box-order-list-empty-placeholder.ui", GLib.UriFlags.NONE) + }, this); + } + // Handle a new drop on `this` properly. // `value` is the thing getting dropped. onDrop(_target, value, _x, _y) { @@ -28,6 +32,4 @@ const PrefsBoxOrderListEmptyPlaceholder = GObject.registerClass({ valueListBox.saveBoxOrderToSettings(); valueListBox.determineRowMoveActionEnable(); } -}); - -export default PrefsBoxOrderListEmptyPlaceholder; +} diff --git a/src/prefsModules/PrefsPage.js b/src/prefsModules/PrefsPage.js index 47f34a6..e871197 100644 --- a/src/prefsModules/PrefsPage.js +++ b/src/prefsModules/PrefsPage.js @@ -11,15 +11,19 @@ import PrefsBoxOrderListEmptyPlaceholder from "./PrefsBoxOrderListEmptyPlacehold // Imports to make UI file work. import PrefsBoxOrderListBox from "./PrefsBoxOrderListBox.js"; -const PrefsPage = GObject.registerClass({ - GTypeName: "PrefsPage", - Template: GLib.uri_resolve_relative(import.meta.url, "../ui/prefs-page.ui", GLib.UriFlags.NONE), - InternalChildren: [ - "left-box-order-list-box", - "center-box-order-list-box", - "right-box-order-list-box" - ] -}, class PrefsPage extends Adw.PreferencesPage { +export default class PrefsPage extends Adw.PreferencesPage { + static { + GObject.registerClass({ + GTypeName: "PrefsPage", + Template: GLib.uri_resolve_relative(import.meta.url, "../ui/prefs-page.ui", GLib.UriFlags.NONE), + InternalChildren: [ + "left-box-order-list-box", + "center-box-order-list-box", + "right-box-order-list-box" + ] + }, this); + } + constructor(params = {}) { super(params); @@ -172,6 +176,4 @@ const PrefsPage = GObject.registerClass({ return; } } -}); - -export default PrefsPage; +}