From 7cecc9e1601b178613db62672b87c85410377c2a Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Sat, 9 Apr 2022 13:13:39 +0200 Subject: [PATCH] :beetle: Ceck for presence of libadwaita --- prefs.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/prefs.js b/prefs.js index 04e7f54..d5809b5 100644 --- a/prefs.js +++ b/prefs.js @@ -96,10 +96,11 @@ var PreferencesDialog = class PreferencesDialog { this.bindSwitch('destroy-dialogs'); - // Starting with GNOME Shell 42, the settings dialog uses libadwaita. We have to use a - // different layout, as the stack sidebar looks pretty ugly with the included - // Adw.Clamp... - if (utils.shellVersionIsAtLeast(42, 'beta')) { + // Starting with GNOME Shell 42, the settings dialog uses libadwaita (at least most of + // the time - it seems that pop!_OS does not support libadwaita even on GNOME 42). We + // have to use a different layout, as the stack sidebar looks pretty ugly with the + // included Adw.Clamp... + if (Adw && utils.shellVersionIsAtLeast(42, 'beta')) { // This is our top-level widget which we will return later. this._widget = new Gtk.Box({orientation: Gtk.Orientation.VERTICAL}); @@ -221,7 +222,7 @@ var PreferencesDialog = class PreferencesDialog { // Starting with GNOME Shell 42, we have to hack our way through the widget tree // of the Adw.PreferencesWindow... - if (utils.shellVersionIsAtLeast(42, 'beta')) { + if (Adw && utils.shellVersionIsAtLeast(42, 'beta')) { const header = this._findWidgetByType(window.get_content(), Adw.HeaderBar); header.pack_end(menu);