gi.Adw is always defined in fillPreferencesWindow

This commit is contained in:
Charles Gagnon
2022-04-27 21:26:30 -04:00
parent 46daaae299
commit 9e9d761342
2 changed files with 9 additions and 19 deletions

View File

@@ -336,8 +336,9 @@ var PanelManager = class {
this.bind_property('opacity', view, 'opacity', GObject.BindingFlags.SYNC_CREATE);
this.add_child(view);
} else {
// todo exorcise this after the GS 42 release
view = new ProxySecondaryMonitorDisplay(i,
// No idea why atm, but we need the import at the top of this file and to use the
// full imports ns here, otherwise SecondaryMonitorDisplay can't be used ¯\_(ツ)_/¯
view = new imports.ui.workspacesView.SecondaryMonitorDisplay(i,
this._controls,
this._scrollAdjustment,
this._fitModeAdjustment,
@@ -504,15 +505,6 @@ var PanelManager = class {
};
// No idea why atm, but we need the import at the top of this file and this
// "proxy" class, otherwise SecondaryMonitorDisplay can't be used ¯\_(ツ)_/¯
var ProxySecondaryMonitorDisplay = GObject.registerClass({
}, class ProxySecondaryMonitorDisplay extends imports.ui.workspacesView.SecondaryMonitorDisplay {
_init(...params) {
super._init(...params)
}
});
// This class drives long-running icon animations, to keep them running in sync
// with each other.
var IconAnimator = class {

View File

@@ -2464,15 +2464,13 @@ function fillPreferencesWindow(window) {
let preferences = new Preferences();
let box = new Gtk.Box({orientation: Gtk.Orientation.VERTICAL});
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()
// 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(new imports.gi.Adw.HeaderBar);
window.add(dummyPage);
window.visible_page = dummyPage
box.append(preferences.notebook);
window.set_content(box);