mirror of
https://gitlab.gnome.org/june/top-bar-organizer.git
synced 2026-01-11 16:53:51 +01:00
Refactor: Move GObject.registerClass calls into static init. blocks
Do that since it standardizes the code and also is just cleaner.
This commit is contained in:
parent
a77c6d2f2b
commit
5ea8f4aabe
4 changed files with 54 additions and 46 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue