Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorManuel Quiñones <manuq@laptop.org>2012-08-23 22:58:38 (GMT)
committer Manuel Quiñones <manuq@laptop.org>2012-08-24 13:18:10 (GMT)
commitbe14c34d355fec27102df19478bc2d4dd3ad3e30 (patch)
treec33b11ef0f538cf55f0631ff749a68afe371afa5 /tests
parent00761f3d01305bb419e0a7a56167879c4b3eb093 (diff)
Use the Sugar Theme in the testsuite
To make useful tests for the Sugar widgets, the theme must be the same. Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/graphics/common.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/graphics/common.py b/tests/graphics/common.py
index 3d20d58..02c3e19 100644
--- a/tests/graphics/common.py
+++ b/tests/graphics/common.py
@@ -20,6 +20,18 @@ from gi.repository import GObject
from sugar3.graphics.toolbutton import ToolButton
+import os
+
+
+def set_theme():
+ settings = Gtk.Settings.get_default()
+ sugar_theme = 'sugar-72'
+ if 'SUGAR_SCALING' in os.environ:
+ if os.environ['SUGAR_SCALING'] == '100':
+ sugar_theme = 'sugar-100'
+ settings.set_property('gtk-theme-name', sugar_theme)
+ settings.set_property('gtk-icon-theme-name', 'sugar')
+
class Test(Gtk.VBox):
def __init__(self):
@@ -45,6 +57,7 @@ class TestPalette(Test):
class TestRunner(object):
def run(self, test):
+ set_theme()
window = Gtk.Window()
window.connect('destroy', lambda w: Gtk.main_quit())
window.add(test)