diff options
author | Daniel Drake <dsd@laptop.org> | 2009-11-27 11:31:42 (GMT) |
---|---|---|
committer | Daniel Drake <dsd@laptop.org> | 2009-12-01 16:51:14 (GMT) |
commit | 634b2fcee0b05e0bb8af9616f12ec60282622503 (patch) | |
tree | 9f45cbdde95c61728e94bcbeb9f195d1f587c50b /src | |
parent | 28a351541685ef02e678e44cff0005c51c0f73e1 (diff) |
Apply font configuration from GConf (#1584)
Sugar font settings are now stored in GConf. This patch applies them
to all users of sugar.style and all standard activities.
Diffstat (limited to 'src')
-rw-r--r-- | src/sugar/activity/activity.py | 3 | ||||
-rw-r--r-- | src/sugar/graphics/style.py | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/sugar/activity/activity.py b/src/sugar/activity/activity.py index d4892d0..a3db42e 100644 --- a/src/sugar/activity/activity.py +++ b/src/sugar/activity/activity.py @@ -280,6 +280,9 @@ class Activity(Window, gtk.Container): self._jobject = None self._read_file_called = False + settings = gtk.settings_get_default() + settings.set_property("gtk-font-name", "%s %f" % (style.FONT_FACE, style.FONT_SIZE)) + self._session = _get_session() self._session.register(self) self._session.connect('quit-requested', diff --git a/src/sugar/graphics/style.py b/src/sugar/graphics/style.py index 6d5e35e..ccc6912 100644 --- a/src/sugar/graphics/style.py +++ b/src/sugar/graphics/style.py @@ -27,6 +27,7 @@ import logging import gtk import pango +import gconf FOCUS_LINE_WIDTH = 2 @@ -115,9 +116,12 @@ MEDIUM_ICON_SIZE = zoom(55 * 1.5) LARGE_ICON_SIZE = zoom(55 * 2.0) XLARGE_ICON_SIZE = zoom(55 * 2.75) -FONT_SIZE = 10 -FONT_NORMAL = Font('Bitstream Vera Sans %d' % FONT_SIZE) -FONT_BOLD = Font('Bitstream Vera Sans bold %d' % FONT_SIZE) +client = gconf.client_get_default() +FONT_SIZE = client.get_float('/desktop/sugar/font/default_size') +FONT_FACE = client.get_string('/desktop/sugar/font/default_face') + +FONT_NORMAL = Font('%s %f' % (FONT_FACE, FONT_SIZE)) +FONT_BOLD = Font('%s %f' % (FONT_FACE, FONT_SIZE)) FONT_NORMAL_H = zoom(24) FONT_BOLD_H = zoom(24) |