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.
This commit is contained in:
Jasper St. Pierre 2014-10-14 22:25:30 -07:00
parent 0f63ad0fc1
commit 48a6e6f309

View File

@ -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;