[Sugar-devel] [PATCH sugar-toolkit-gtk3] Set the sugar theme name in gsettings according the scale

Simon Schampijer simon at schampijer.de
Thu Dec 15 11:28:30 EST 2011


From: Gonzalo Odiard <gonzalo at laptop.org>

We need set the theme in gsettings according the scale in
the SUGAR_SCLING environment variable.

Signed-off-by: Gonzalo Odiard <gonzalo at laptop.org>
---
 src/sugar3/activity/activity.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/sugar3/activity/activity.py b/src/sugar3/activity/activity.py
index 5e9986d..aedcae8 100644
--- a/src/sugar3/activity/activity.py
+++ b/src/sugar3/activity/activity.py
@@ -272,10 +272,15 @@ class Activity(Window, Gtk.Container):
         icons_path = os.path.join(get_bundle_path(), 'icons')
         Gtk.IconTheme.get_default().append_search_path(icons_path)
 
+        sugar_theme = 'sugar-72'
+        if 'SUGAR_SCALING' in os.environ:
+            if os.environ['SUGAR_SCALING'] == '100':
+                sugar_theme = 'sugar-100'
+
         # This code can be removed when we grow an xsettings daemon (the GTK+
         # init routines will then automatically figure out the font settings)
         settings = Gtk.Settings.get_default()
-        settings.set_property('gtk-theme-name', 'sugar')
+        settings.set_property('gtk-theme-name', sugar_theme)
         settings.set_property('gtk-icon-theme-name', 'sugar')
         settings.set_property('gtk-font-name',
                               '%s %f' % (style.FONT_FACE, style.FONT_SIZE))
-- 
1.7.7.3



More information about the Sugar-devel mailing list