From 985035ea583cbd1c81c4fca408ddfbd1d4fedd7f Mon Sep 17 00:00:00 2001
From: Ishan Bansal <ishan@seeta.in>
Date: Sun, 26 Sep 2010 01:46:16 +0530
Subject: [PATCH] Scale TA font proportional to Sugar font-settings. (SL#1858)
This patch scales the font in TA by using function zoom set in
sugar.graphics.style (SL#1858)
---
TurtleArt/tawindow.py | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index ac16d9c..696a1bd 100644
a
|
b
|
try: |
35 | 35 | from sugar.graphics.objectchooser import ObjectChooser |
36 | 36 | from sugar.datastore import datastore |
37 | 37 | from sugar import profile |
| 38 | from sugar.graphics import style |
38 | 39 | except ImportError: |
39 | 40 | pass |
40 | 41 | |
… |
… |
class TurtleArtWindow(): |
127 | 128 | self.orientation = HORIZONTAL_PALETTE |
128 | 129 | if olpc_xo_1(): |
129 | 130 | self.lead = 1.0 |
130 | | self.scale = 0.67 |
| 131 | self.scale = 0.67 * style.zoom(1) |
131 | 132 | self.color_mode = '565' |
132 | 133 | if self.running_sugar and not self.activity.new_sugar_system: |
133 | 134 | self.orientation = VERTICAL_PALETTE |
134 | 135 | else: |
135 | 136 | self.lead = 1.0 |
136 | | self.scale = 1.0 |
| 137 | self.scale = 1.0 * style.zoom(1) |
137 | 138 | self.color_mode = '888' # TODO: Read visual mode from gtk image |
138 | 139 | |
139 | 140 | self.block_scale = BLOCK_SCALE |
140 | | self.trash_scale = 0.5 |
| 141 | self.trash_scale = 0.5 * style.zoom(1) |
141 | 142 | self.myblock = None |
142 | 143 | self.nop = 'nop' |
143 | 144 | self.loaded = 0 |
… |
… |
class TurtleArtWindow(): |
2156 | 2157 | blk.spr.set_label(blk.values[0].replace('\n', RETURN)) |
2157 | 2158 | elif btype == 'start': # block size is saved in start block |
2158 | 2159 | if value is not None: |
2159 | | self.block_scale = value |
| 2160 | self.block_scale = value * style.zoom(1) |
2160 | 2161 | elif btype in EXPANDABLE or btype in EXPANDABLE_BLOCKS or \ |
2161 | 2162 | btype in EXPANDABLE_ARGS or btype == 'nop': |
2162 | 2163 | if btype == 'vspace' or btype in EXPANDABLE_BLOCKS: |