From d942e255f734eddc4bb1d4698aea75aafe52072f Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Mon, 2 May 2011 18:07:39 +0200 Subject: [PATCH] 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. --- extensions/user-theme/extension.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/extensions/user-theme/extension.js b/extensions/user-theme/extension.js index a9f095ee..b0b041e9 100644 --- a/extensions/user-theme/extension.js +++ b/extensions/user-theme/extension.js @@ -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(); } }