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.
master
Daniel Drake 15 years ago
parent 28a3515416
commit 634b2fcee0

@ -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',

@ -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)

Loading…
Cancel
Save