Skip to content

Commit

Permalink
gi.Adw is always defined in fillPreferencesWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesg99 committed Apr 28, 2022
1 parent 46daaae commit 9e9d761
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
14 changes: 3 additions & 11 deletions panelManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down
16 changes: 7 additions & 9 deletions prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()

box.append(new imports.gi.Adw.HeaderBar);
window.add(dummyPage);
window.visible_page = dummyPage
}
// 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);
Expand Down

0 comments on commit 9e9d761

Please sign in to comment.