[gnome-shell] extensionSystem: Allow extensions to provide mode-specific styling
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] extensionSystem: Allow extensions to provide mode-specific styling
- Date: Tue, 5 Feb 2013 18:55:04 +0000 (UTC)
commit 234470646239f4f0ba0fc4df028f303029480128
Author: Florian MÃllner <fmuellner gnome org>
Date: Tue Feb 5 18:45:21 2013 +0100
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.
https://bugzilla.gnome.org/show_bug.cgi?id=693219
js/ui/extensionSystem.js | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
index 5e4bd6c..8c12e97 100644
--- a/js/ui/extensionSystem.js
+++ b/js/ui/extensionSystem.js
@@ -106,11 +106,15 @@ function enableExtension(uuid) {
extensionOrder.push(uuid);
- let stylesheetFile = extension.dir.get_child('stylesheet.css');
- if (stylesheetFile.query_exists(null)) {
- let theme = St.ThemeContext.get_for_stage(global.stage).get_theme();
- theme.load_stylesheet(stylesheetFile.get_path());
- extension.stylesheet = stylesheetFile;
+ let stylesheetNames = [global.session_mode + '.css', 'stylesheet.css'];
+ for (let i = 0; i < stylesheetNames.length; i++) {
+ let stylesheetFile = extension.dir.get_child(stylesheetNames[i]);
+ if (stylesheetFile.query_exists(null)) {
+ let theme = St.ThemeContext.get_for_stage(global.stage).get_theme();
+ theme.load_stylesheet(stylesheetFile.get_path());
+ extension.stylesheet = stylesheetFile;
+ break;
+ }
}
extension.stateObj.enable();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]