mirror of
https://gitlab.gnome.org/julianschacher/top-bar-organizer.git
synced 2025-10-27 07:09:07 +00:00
Migrate with the help of, among others, the following resources: https://blogs.gnome.org/shell-dev/2023/09/02/extensions-in-gnome-45/ https://gjs.guide/extensions/upgrading/gnome-shell-45.html Only support GNOME Shell version 45, since only 45 is compatible with the new ESM system. Since panel._originalAddToPanelBox is no longer valid, just overwrite using the prototype on disable. Add "sourceType": "module" to eslintrc.yml to get rid of: "Parsing error: 'import' and 'export' may appear only with 'sourceType: module'" See here: https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options
33 lines
965 B
JavaScript
33 lines
965 B
JavaScript
"use strict";
|
|
|
|
import Gtk from "gi://Gtk";
|
|
import Gdk from "gi://Gdk";
|
|
|
|
import { ExtensionPreferences } from "resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js";
|
|
|
|
import PrefsPage from "./prefsModules/PrefsPage.js";
|
|
|
|
export default class TopBarOrganizerPreferences extends ExtensionPreferences {
|
|
getPreferencesWidget() {
|
|
const provider = new Gtk.CssProvider();
|
|
provider.load_from_path(this.metadata.dir.get_path() + "/css/prefs.css");
|
|
const defaultGdkDisplay = Gdk.Display.get_default();
|
|
Gtk.StyleContext.add_provider_for_display(
|
|
defaultGdkDisplay,
|
|
provider,
|
|
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
|
|
);
|
|
|
|
const prefsPage = new PrefsPage();
|
|
|
|
prefsPage.connect("destroy", () => {
|
|
Gtk.StyleContext.remove_provider_for_display(
|
|
defaultGdkDisplay,
|
|
provider
|
|
);
|
|
});
|
|
|
|
return prefsPage;
|
|
}
|
|
}
|