[gnome-shell] Factor out a function to load the default theme
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Factor out a function to load the default theme
- Date: Fri, 7 Jan 2011 20:24:43 +0000 (UTC)
commit 512798f9c698b92bfe4aebb7fbc10a04d452991c
Author: Maxim Ermilov <zaspire rambler ru>
Date: Tue Jan 4 14:30:03 2011 -0500
Factor out a function to load the default theme
We will use this function elsewhere when the theme needs to be reloaded.
https://bugzilla.gnome.org/show_bug.cgi?id=630428
js/ui/main.js | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/main.js b/js/ui/main.js
index e08781b..86e5102 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -109,10 +109,7 @@ function start() {
global.stage.color = DEFAULT_BACKGROUND_COLOR;
global.stage.no_clear_hint = true;
- let themeContext = St.ThemeContext.get_for_stage (global.stage);
- let stylesheetPath = global.datadir + '/theme/gnome-shell.css';
- let theme = new St.Theme ({ application_stylesheet: stylesheetPath });
- themeContext.set_theme (theme);
+ loadTheme();
let shellwm = global.window_manager;
shellwm.takeover_keybinding('panel_main_menu');
@@ -202,6 +199,18 @@ function start() {
}
/**
+ * loadTheme:
+ *
+ * Reloads the theme CSS file from the default theme.
+ */
+function loadTheme() {
+ let themeContext = St.ThemeContext.get_for_stage (global.stage);
+ let stylesheetPath = global.datadir + '/theme/gnome-shell.css';
+ let theme = new St.Theme ({ application_stylesheet: stylesheetPath });
+ themeContext.set_theme (theme);
+}
+
+/**
* _log:
* @category: string message type ('info', 'error')
* @msg: A message string
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]