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>
This commit is contained in:
Manuel Quiñones 2012-08-23 19:58:38 -03:00
parent 00761f3d01
commit be14c34d35

View File

@ -20,6 +20,18 @@ from gi.repository import GObject
from sugar3.graphics.toolbutton import ToolButton 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): class Test(Gtk.VBox):
def __init__(self): def __init__(self):
@ -45,6 +57,7 @@ class TestPalette(Test):
class TestRunner(object): class TestRunner(object):
def run(self, test): def run(self, test):
set_theme()
window = Gtk.Window() window = Gtk.Window()
window.connect('destroy', lambda w: Gtk.main_quit()) window.connect('destroy', lambda w: Gtk.main_quit())
window.add(test) window.add(test)