[Pkg-sugar-commit] [sugar-toolkit] 55/118: Apply font configuration from GConf (#1584)
Jonas Smedegaard
dr at jones.dk
Thu Apr 16 18:49:40 UTC 2015
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag debian/0.84.10-1
in repository sugar-toolkit.
commit 0078dc8438a51e949c88beab6b0c14b8b4466f80
Author: Daniel Drake <dsd at laptop.org>
Date: Fri Nov 27 11:31:42 2009 +0000
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.
---
src/sugar/activity/activity.py | 3 +++
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 9043a3c..32f9a05 100644
--- a/src/sugar/activity/activity.py
+++ b/src/sugar/activity/activity.py
@@ -485,6 +485,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 591957b..4bccd89 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
_TAB_CURVATURE = 1
@@ -107,9 +108,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)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-sugar/sugar-toolkit.git
More information about the pkg-sugar-commit
mailing list