gnome-shell/js
Florian Müllner 797df4f52f extensions: Make ExtensionPreferences more flexible
Extensions must now export a class with a fillPreferencesWindow()
method in their prefs. That is less convenient for extensions
with simple preferences than the old buildPrefsWidget() hook, as
they must wrap their widget in page/group widgets.

Address this by adding a default fillPreferencesWindow() implementation
that calls a getPreferencesWidget() method and wraps it as necessary.

This is flexible enough to support different cases fairly conveniently,
from simple single-widget prefs over tweaking the window to complex
multi-page prefs:

```js
class SimplePreferences extends ExtensionPreferences {
    getPreferencesWidget() {
        return new SimplePrefsWidget();
    }
}

class TinkerPreferences extends ExtensionPreferences {
    getPreferencesWidget() {
        return new SimplePrefsWidget();
    }

    fillPreferencesWindow(window) {
        super.fillPreferencesWindow(window);

        window.set_default_size(123, 456);
    }
}

class FullPreferences extends ExtensionPreferences {
    fillPreferencesWindow(window) {
        const page1 = new GeneralPage();
        window.add(page1);

        const page2 = new FoobarPage();
        window.add(page2);
    }
}
```

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>
2023-07-30 10:29:44 +03:00
..
dbusServices dbusServices/extensions: Include dir and path in metadata 2023-07-29 15:20:20 +03:00
extensions extensions: Make ExtensionPreferences more flexible 2023-07-30 10:29:44 +03:00
gdm animationUtils: Group together various animation helpers 2023-07-15 02:35:56 +00:00
misc extensionUtils: Split out extension convenience functions 2023-07-15 13:16:42 +02:00
portalHelper portalHelper: Port to ESM 2023-06-21 13:26:42 +02:00
ui extensionSystem: Include dir and path in data passed to extension 2023-07-29 15:20:20 +03:00
js-resources.gresource.xml status/camera: New indicator 2023-07-29 13:55:15 +03:00
meson.build extensions-app: Move Extensions app to new subproject 2020-03-27 23:33:30 +00:00
portal-resources.gresource.xml js/portal-resources: Add missing fileUtils to js path 2022-11-03 18:02:27 +00:00