Compare commits
1 Commits
citadel
...
theme-sear
Author | SHA1 | Date | |
---|---|---|---|
|
9ab35786f6 |
@ -14,6 +14,7 @@ const St = imports.gi.St;
|
|||||||
const AccessDialog = imports.ui.accessDialog;
|
const AccessDialog = imports.ui.accessDialog;
|
||||||
const AudioDeviceSelection = imports.ui.audioDeviceSelection;
|
const AudioDeviceSelection = imports.ui.audioDeviceSelection;
|
||||||
const Components = imports.ui.components;
|
const Components = imports.ui.components;
|
||||||
|
const Config = imports.misc.config;
|
||||||
const CtrlAltTab = imports.ui.ctrlAltTab;
|
const CtrlAltTab = imports.ui.ctrlAltTab;
|
||||||
const EndSessionDialog = imports.ui.endSessionDialog;
|
const EndSessionDialog = imports.ui.endSessionDialog;
|
||||||
const Environment = imports.ui.environment;
|
const Environment = imports.ui.environment;
|
||||||
@ -249,28 +250,63 @@ function _initializeUI() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function _getStylesheet(name) {
|
function _findThemeDirByVersion(dir, major, minor, name) {
|
||||||
|
let path;
|
||||||
let stylesheet;
|
let stylesheet;
|
||||||
|
let subpath;
|
||||||
|
|
||||||
stylesheet = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/' + name);
|
/* Don't search back to before we introduced this support */
|
||||||
if (stylesheet.query_exists(null))
|
let max_minor = (major == 3) ? 28 : 0;
|
||||||
|
|
||||||
|
for (let i = minor; i >= max_minor; i = i - 2) {
|
||||||
|
subpath = major + '.' + i;
|
||||||
|
path = GLib.build_filenamev([dir, 'gnome-shell', subpath, 'theme', name]);
|
||||||
|
stylesheet = Gio.file_new_for_path(path);
|
||||||
|
|
||||||
|
log('Checking for ' + path);
|
||||||
|
|
||||||
|
if (stylesheet.query_exists(null)) {
|
||||||
|
log('Using ' + path);
|
||||||
return stylesheet;
|
return stylesheet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let dataDirs = GLib.get_system_data_dirs();
|
path = GLib.build_filenamev([dir, 'gnome-shell', 'theme', name]);
|
||||||
for (let i = 0; i < dataDirs.length; i++) {
|
stylesheet = Gio.file_new_for_path(path);
|
||||||
let path = GLib.build_filenamev([dataDirs[i], 'gnome-shell', 'theme', name]);
|
|
||||||
let stylesheet = Gio.file_new_for_path(path);
|
if (stylesheet.query_exists(null)) {
|
||||||
if (stylesheet.query_exists(null))
|
log('Using unversioned' + path);
|
||||||
return stylesheet;
|
return stylesheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
stylesheet = Gio.File.new_for_path(global.datadir + '/theme/' + name);
|
|
||||||
if (stylesheet.query_exists(null))
|
|
||||||
return stylesheet;
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _getStylesheet(name) {
|
||||||
|
let stylesheet;
|
||||||
|
|
||||||
|
let [major, minor] = Config.PACKAGE_VERSION.split('.');
|
||||||
|
|
||||||
|
// Directories are versioned according to the stable version
|
||||||
|
if ((minor % 2) == 1)
|
||||||
|
minor++;
|
||||||
|
|
||||||
|
stylesheet = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/' + name);
|
||||||
|
if (stylesheet.query_exists(null)) {
|
||||||
|
log('Using built-in default theme ' + name)
|
||||||
|
return stylesheet;
|
||||||
|
}
|
||||||
|
|
||||||
|
let dataDirs = GLib.get_system_data_dirs();
|
||||||
|
for (let i = 0; i < dataDirs.length; i++) {
|
||||||
|
stylesheet = _findThemeDirByVersion(dataDirs[i], major, minor, name)
|
||||||
|
if (stylesheet != null)
|
||||||
|
return stylesheet;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _findThemeDirByVersion(global.datadir, major, minor, name);
|
||||||
|
}
|
||||||
|
|
||||||
function _getDefaultStylesheet() {
|
function _getDefaultStylesheet() {
|
||||||
let stylesheet = null;
|
let stylesheet = null;
|
||||||
let name = sessionMode.stylesheetName;
|
let name = sessionMode.stylesheetName;
|
||||||
|
Loading…
Reference in New Issue
Block a user