sessionMode: Add stylesheetName property
This will allow to visually differentiate modes by providing separate styling. https://bugzilla.gnome.org/show_bug.cgi?id=693219
This commit is contained in:
parent
7f587fd4da
commit
fcc32fca7e
@ -95,6 +95,8 @@ function start() {
|
||||
Gio.DesktopAppInfo.set_desktop_env('GNOME');
|
||||
|
||||
sessionMode = new SessionMode.SessionMode();
|
||||
sessionMode.connect('updated', _loadDefaultStylesheet);
|
||||
|
||||
shellDBusService = new ShellDBus.GnomeShell();
|
||||
shellMountOpDBusService = new ShellMountOperation.GnomeShellMountOpHandler();
|
||||
|
||||
@ -117,8 +119,7 @@ function start() {
|
||||
global.stage.color = DEFAULT_BACKGROUND_COLOR;
|
||||
global.stage.no_clear_hint = true;
|
||||
|
||||
_defaultCssStylesheet = global.datadir + '/theme/gnome-shell.css';
|
||||
loadTheme();
|
||||
_loadDefaultStylesheet();
|
||||
|
||||
// Set up stage hierarchy to group all UI actors under one container.
|
||||
uiGroup = new Shell.GenericContainer({ name: 'uiGroup' });
|
||||
@ -379,6 +380,18 @@ function _nWorkspacesChanged() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function _loadDefaultStylesheet() {
|
||||
if (!Main.sessionMode.isPrimary)
|
||||
return;
|
||||
|
||||
let stylesheet = global.datadir + '/theme/' + sessionMode.stylesheetName;
|
||||
if (_defaultCssStylesheet == stylesheet)
|
||||
return;
|
||||
|
||||
_defaultCssStylesheet = stylesheet;
|
||||
loadTheme();
|
||||
}
|
||||
|
||||
/**
|
||||
* getThemeStylesheet:
|
||||
*
|
||||
|
@ -15,6 +15,7 @@ const DEFAULT_MODE = 'restrictive';
|
||||
const _modes = {
|
||||
'restrictive': {
|
||||
parentMode: null,
|
||||
stylesheetName: 'gnome-shell.css',
|
||||
hasOverview: false,
|
||||
showCalendarEvents: false,
|
||||
allowSettings: false,
|
||||
|
Loading…
Reference in New Issue
Block a user