Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAjay Garg <ajay@activitycentral.com>2012-12-26 10:11:08 (GMT)
committer Ajay Garg <ajay@activitycentral.com>2012-12-26 10:12:27 (GMT)
commitdb124b3869b404c41a267ac24b8a0c9f3413354b (patch)
treeaa1f4dc7201b261df5793d8b02857c655ad117d3
parent5235de1a11a7d458ff90e072dcb405004aedd267 (diff)
sdxo#2781: Now, theme is loaded from a different script.
Signed-off-by: Ajay Garg <ajay@activitycentral.com>
-rwxr-xr-xbin/sugar-session21
1 files changed, 20 insertions, 1 deletions
diff --git a/bin/sugar-session b/bin/sugar-session
index 638218f..a8836d2 100755
--- a/bin/sugar-session
+++ b/bin/sugar-session
@@ -279,9 +279,28 @@ def set_fonts():
def set_theme():
settings = Gtk.Settings.get_default()
sugar_theme = 'sugar-72'
+
+ """
+ Fetch the theme from Gconf.
+ """
+ client = GConf.Client.get_default()
+ theme = client.get_string('/desktop/sugar/interface/gtk_theme')
+
+ """
+ See if 'SUGAR_SCALING' is set.
+ """
+ scaling_set = False
if 'SUGAR_SCALING' in os.environ:
if os.environ['SUGAR_SCALING'] == '100':
- sugar_theme = 'sugar-100'
+ scaling_set = True
+
+ if (theme == 'sugar-contrast') and (scaling_set):
+ sugar_theme = 'sugar-100-contrast'
+ elif (theme == 'sugar-contrast') and (not scaling_set):
+ sugar_theme = 'sugar-72-contrast'
+ elif scaling_set:
+ sugar_theme = 'sugar-100'
+
settings.set_property('gtk-theme-name', sugar_theme)
settings.set_property('gtk-icon-theme-name', 'sugar')