From 48a6e6f3098dccf5b857fd7d436a2ba4dc9ba90c Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 14 Oct 2014 22:25:30 -0700 Subject: [PATCH] main: Allow loading file-based stylesheets again The gnome-classic mode ships a stylesheet on disk, so make sure to load that if if we can't find any file in the resource itself. --- js/ui/main.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/js/ui/main.js b/js/ui/main.js index 149e25a05..2fff9e654 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -227,11 +227,25 @@ function _initializeUI() { }); } +function _getDefaultStylesheet() { + let stylesheet; + + stylesheet = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/' + sessionMode.stylesheetName); + if (stylesheet.query_exists(null)) + return stylesheet; + + stylesheet = Gio.File.new_for_path(global.datadir + '/theme/' + sessionMode.stylesheetName); + if (stylesheet.query_exists(null)) + return stylesheet; + + return null; +} + function _loadDefaultStylesheet() { if (!sessionMode.isPrimary) return; - let stylesheet = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/' + sessionMode.stylesheetName); + let stylesheet = _getDefaultStylesheet(); if (_defaultCssStylesheet && _defaultCssStylesheet.equal(stylesheet)) return;