From 1c8ed8df9226624b6659b0b8aec9d5b9c0ff91b2 Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Sun, 5 Feb 2023 20:29:29 +0100 Subject: [PATCH] :memo: Add some comments --- prefs.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/prefs.js b/prefs.js index 0b6ef17..4867aad 100644 --- a/prefs.js +++ b/prefs.js @@ -349,6 +349,11 @@ var PreferencesDialog = class PreferencesDialog { header.pack_start(menu); header.set_title_widget(this._builder.get_object('profile-button')); + // GNOME Shell extensions are forced to use a AdwPreferencesWindow. This already + // includes a Gtk.ScrolledWindow as well as an Adw.Clamp. For the profile + // editing, we want to use an Adw.Flap which reveals itself from the top. This + // needs to be inserted in the widget hierarchy above the Adw.Clamp, else it + // would look ugly. Therefore, we fiddle around with the internal widgets... const flap = this._builder.get_object('profile-editor-flap'); const clamp = this._findWidgetByType(window.get_content(), Adw.Clamp); const viewport = clamp.get_parent(); @@ -901,6 +906,8 @@ function buildPrefsWidget() { return dialog.getWidget(); } +// If using libadwaita, this method is called. In this case, the primary widget of the +// preferences dialog is an Adw.PreferencesPage, which we directly add to the window. function fillPreferencesWindow(window) { window.set_default_size(700, 700); var dialog = new PreferencesDialog();