user-theme: fix resetting theme to null

Previously null stylesheets were ignored, making it impossible to
reset the default. We still need to filter out invalid (non existing)
stylesheets, as no check is performed by shell code.
This commit is contained in:
Giovanni Campagna
2011-05-02 18:07:39 +02:00
parent f016b95f77
commit d942e255f7

View File

@@ -29,13 +29,16 @@ ThemeManager.prototype = {
file = Gio.file_new_for_path(_userCssStylesheet);
if (file.query_exists(null))
_stylesheet = _userCssStylesheet;
else
_stylesheet = null;
}
if (_stylesheet) {
global.log('loading user theme: ' + _stylesheet)
Main.setThemeStylesheet(_stylesheet);
Main.loadTheme();
}
if (_stylesheet)
global.log('loading user theme: ' + _stylesheet);
else
global.log('loading default theme (Adwaita)');
Main.setThemeStylesheet(_stylesheet);
Main.loadTheme();
}
}