Stop 'Extension did not provide any UI' error

Fixes #1633
This commit is contained in:
Charles Gagnon
2022-04-19 18:24:50 -04:00
parent 1d6c052412
commit a0cfefb627

View File

@@ -2464,7 +2464,16 @@ function fillPreferencesWindow(window) {
let preferences = new Preferences();
let box = new Gtk.Box({orientation: Gtk.Orientation.VERTICAL});
imports.gi.Adw && box.append(new imports.gi.Adw.HeaderBar);
if (imports.gi.Adw) {
// dummy page to prevent 'Extension did not provide any UI'
// error until we migrate to Adw
let dummyPage = new imports.gi.Adw.PreferencesPage()
box.append(new imports.gi.Adw.HeaderBar);
window.add(dummyPage);
window.visible_page = dummyPage
}
box.append(preferences.notebook);
window.set_content(box);
}