[Sugar-devel] [PATCH] Scale TA font proportional to Sugar font-settings. (SL#1858)

Kandarp Kaushik kandarp at seeta.in
Fri Sep 10 12:51:11 EDT 2010


This patch scales the font in TA by using ZOOM_FACTOR
set in sugar.graphics.style (SL#1858)
---
 tawindow.py |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tawindow.py b/tawindow.py
index 6a5629e..271c78b 100644
--- a/tawindow.py
+++ b/tawindow.py
@@ -33,6 +33,7 @@ from gettext import gettext as _
 
 try:
     from sugar.graphics.objectchooser import ObjectChooser
+    from sugar.graphics.style import ZOOM_FACTOR
     from sugar.datastore import datastore
     from sugar import profile
 except ImportError:
@@ -124,16 +125,16 @@ class TurtleArtWindow():
         self.orientation = HORIZONTAL_PALETTE
         if olpc_xo_1():
             self.lead = 1.0
-            self.scale = 0.67
+            self.scale = 0.67 * ZOOM_FACTOR
             self.color_mode = '565'
             if self.running_sugar and not self.activity.new_sugar_system:
                 self.orientation = VERTICAL_PALETTE
         else:
             self.lead = 1.0
-            self.scale = 1.0
+            self.scale = 1.0 * ZOOM_FACTOR
             self.color_mode = '888' # TODO: Read visual mode from gtk image
 
-        self.block_scale = BLOCK_SCALE
+        self.block_scale = BLOCK_SCALE * ZOOM_FACTOR
         self.trash_scale = 0.5
         self.myblock = None
         self.nop = 'nop'
@@ -2001,7 +2002,7 @@ class TurtleArtWindow():
             blk.spr.set_label(blk.values[0].replace('\n', RETURN))
         elif btype == 'start': # block size is saved in start block
             if value is not None:
-                self.block_scale = value
+                self.block_scale = value * ZOOM_FACTOR
         elif btype in EXPANDABLE or btype == 'nop':
             if btype == 'vspace':
                 if value is not None:
-- 
1.7.1



More information about the Sugar-devel mailing list