Listen to the root property change to get the preferences window

This commit is contained in:
Romain Vigier
2021-09-05 15:25:18 +02:00
parent 58f50a6d17
commit dc4d67801b
+1 -1
View File
@@ -31,7 +31,7 @@ function init() {
*/ */
function buildPrefsWidget() { function buildPrefsWidget() {
const preferences = new Preferences(); const preferences = new Preferences();
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => { preferences.connect('notify::root', () => {
const window = preferences.get_root(); const window = preferences.get_root();
window.add_css_class('nightthemeswitcher'); window.add_css_class('nightthemeswitcher');
const headerbar = new Headerbar({ preferences }); const headerbar = new Headerbar({ preferences });