GNOME Bugzilla – Bug 693219
sessionMode: Add support for mode-specific styling
Last modified: 2013-02-05 18:55:39 UTC
The new classic mode should be visually distinct from normal mode, so add a simple mechanism for mode-specific styling.
Created attachment 235240 [details] [review] sessionMode: Add stylesheetName property This will allow to visually differentiate modes by providing separate styling.
Created attachment 235241 [details] [review] extensionSystem: Allow extensions to provide mode-specific styling Allow extensions to integrate with modes that provide a distinct style by providing a mode-specific stylesheet.
Review of attachment 235240 [details] [review]: ::: js/ui/main.js @@ +383,3 @@ +function _loadDefaultStylesheet() { + _defaultCssStylesheet = global.datadir + '/theme/' + sessionMode.stylesheetName; + loadTheme(); Loading a theme is expensive, it would be better if we checked that it actually changed. Also, global.datadir is /usr/share/gnome-shell. Do you want gnome-shell-extensions to install there?
Review of attachment 235241 [details] [review]: Ok
Review of attachment 235241 [details] [review]: This doesn't make sense to me, as the stylesheet being loaded now depends on the session mode that we're in when the extension is enabled. We don't swap it out when the session mode changes.
(In reply to comment #5) > Review of attachment 235241 [details] [review]: > > This doesn't make sense to me, as the stylesheet being loaded now depends on > the session mode that we're in when the extension is enabled. We don't swap it > out when the session mode changes. No, it's global.session_mode, not Main.sessionMode. It's the session mode that was chosen at shell startup (gdm, shell or classic), not including the temporary ones.
(Plus, extensions get disabled outside of shell/classic, so it's a moot point really)
Oh, whoops. We maybe should rename that to global.startup_session_mode, so it's not too confusing.
Created attachment 235250 [details] [review] sessionMode: Add stylesheetName property - add check for actual stylesheet changes before loading theme - restrict mode-specific stylesheets to primary modes (to be consistent with mode-specific extension stylesheets) Regarding global.datadir, it's actually $PREFIX/share/gnome-shell - given that classic mode already assumes that gnome-session, gnome-shell and gnome-shell-extensions are installed to the same prefix (session file, mode file), I don't see anything particularly wrong with making the same assumption for the stylesheet.
Review of attachment 235250 [details] [review]: What I was really complaining about was reusing the gnome-shell subdirectory of $(datadir), but thinking of it again it probably makes sense.
Attachment 235241 [details] pushed as 2344706 - extensionSystem: Allow extensions to provide mode-specific styling Attachment 235250 [details] pushed as fcc32fc - sessionMode: Add stylesheetName property