diff options
Diffstat (limited to 'extensions/45/vertical-workspaces/lib/optionsFactory.js')
-rw-r--r-- | extensions/45/vertical-workspaces/lib/optionsFactory.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/extensions/45/vertical-workspaces/lib/optionsFactory.js b/extensions/45/vertical-workspaces/lib/optionsFactory.js index c20885e..05e14b0 100644 --- a/extensions/45/vertical-workspaces/lib/optionsFactory.js +++ b/extensions/45/vertical-workspaces/lib/optionsFactory.js @@ -3,7 +3,7 @@ * optionsFactory.js * * @author GdH <G-dH@github.com> - * @copyright 2022 - 2023 + * @copyright 2022 - 2024 * @license GPL-3.0 */ @@ -130,7 +130,7 @@ export const ItemFactory = class ItemFactory { for (let i = 0; i < options.length; i++) { const text = options[i][0]; const id = options[i][1]; - model.append(new DropDownItemVW({ text, id })); + model.append(new DropDownItem({ text, id })); if (id === currentValue) widget.set_selected(i); } @@ -205,7 +205,7 @@ export const ItemFactory = class ItemFactory { newDropDown() { const dropDown = new Gtk.DropDown({ model: new Gio.ListStore({ - item_type: DropDownItemVW, + item_type: DropDownItem, }), halign: Gtk.Align.END, valign: Gtk.Align.CENTER, @@ -457,8 +457,9 @@ export const AdwPrefs = class { } }; -const DropDownItemVW = GObject.registerClass({ - GTypeName: 'DropDownItemVW', +const DropDownItem = GObject.registerClass({ + // Registered name should be unique + GTypeName: `DropDownItem${Math.floor(Math.random() * 1000)}`, Properties: { 'text': GObject.ParamSpec.string( 'text', @@ -476,7 +477,7 @@ const DropDownItemVW = GObject.registerClass({ -2147483648, 2147483647, 0 ), }, -}, class DropDownItemVW extends GObject.Object { +}, class DropDownItem extends GObject.Object { get text() { return this._text; } |