[Commits] typing-turtle branch master updated.

Wade Brainerd wadetb at gmail.com
Thu Jan 8 21:47:08 EST 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "/home/olpc-code/git/activities/typing-turtle".

The branch, master has been updated
       via  c96c23528476bcd7d3194c6174c1ac8baae5d869 (commit)
      from  40189fa93e5dcd67abb37a26e0621a817b60a122 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

 keyboard.py     |    9 +++++----
 lessonscreen.py |   15 +++++++--------
 2 files changed, 12 insertions(+), 12 deletions(-)

- Log -----------------------------------------------------------------
commit c96c23528476bcd7d3194c6174c1ac8baae5d869
Author: Wade Brainerd <wadetb at gmail.com>
Date:   Fri Jan 9 02:46:42 2009 +0000

    Make key images a little bigger.
    Tweak font size.

diff --git a/keyboard.py b/keyboard.py
index e7537b1..b30c18d 100644
--- a/keyboard.py
+++ b/keyboard.py
@@ -620,15 +620,16 @@ class KeyboardWidget(KeyboardData, gtk.DrawingArea):
         self.draw_hands = enable
         self.queue_draw()
 
-    def get_key_pixbuf(self, key, state=0, group=0):
-        w = key['key-width']
-        h = key['key-height']
+    def get_key_pixbuf(self, key, state=0, group=0, scale=1):
+        w = key['key-width'] * scale
+        h = key['key-height'] * scale
         
         pixmap = gtk.gdk.Pixmap(self.root_window.window, w, h)
         
         cr = pixmap.cairo_create()
+        cr.scale(scale, scale)
         cr.translate(-key['key-x'], -key['key-y'])
-        
+
         old_state, old_group = self.active_state, self.active_group
         self.active_state, self.active_group = state, group
         
diff --git a/lessonscreen.py b/lessonscreen.py
index 3111071..7ff77a1 100644
--- a/lessonscreen.py
+++ b/lessonscreen.py
@@ -79,29 +79,28 @@ class LessonScreen(gtk.VBox):
         # Set up font styles.
         self.tagtable = gtk.TextTagTable()
         instructions_tag = gtk.TextTag('instructions')
-        instructions_tag.props.size = 10000
+        instructions_tag.props.size = 9000
         instructions_tag.props.justification = gtk.JUSTIFY_CENTER
         self.tagtable.add(instructions_tag)
 
         text_tag = gtk.TextTag('text')
         text_tag.props.family = 'Monospace'
-        text_tag.props.size = 10000
+        text_tag.props.size = 9000
         self.tagtable.add(text_tag)
         
         image_tag = gtk.TextTag('image')
         image_tag.props.justification = gtk.JUSTIFY_CENTER
-        image_tag.props.size = 20000
         self.tagtable.add(image_tag)
         
         correct_copy_tag = gtk.TextTag('correct-copy')
         correct_copy_tag.props.family = 'Monospace'
-        correct_copy_tag.props.size = 10000
+        correct_copy_tag.props.size = 9000
         correct_copy_tag.props.foreground = '#0000ff'
         self.tagtable.add(correct_copy_tag)
         
         incorrect_copy_tag = gtk.TextTag('incorrect-copy')
         incorrect_copy_tag.props.family = 'Monospace'
-        incorrect_copy_tag.props.size = 10000
+        incorrect_copy_tag.props.size = 9000
         incorrect_copy_tag.props.foreground = '#ff0000'
         self.tagtable.add(incorrect_copy_tag)
         
@@ -269,17 +268,17 @@ class LessonScreen(gtk.VBox):
             if key:
                 if state & gtk.gdk.SHIFT_MASK:
                     shift_key = self.keyboard.find_key_by_label('shift')
-                    pixbuf = self.keyboard.get_key_pixbuf(shift_key)
+                    pixbuf = self.keyboard.get_key_pixbuf(shift_key, scale=1.25)
                     self.lessonbuffer.insert_pixbuf(self.lessonbuffer.get_end_iter(), pixbuf)
                     self.lessonbuffer.insert(self.lessonbuffer.get_end_iter(), ' ')
                 
                 if state & gtk.gdk.MOD5_MASK:
-                    altgr_key = self.keyboard.find_key_by_label('altgr')
+                    altgr_key = self.keyboard.find_key_by_label('altgr', scale=1.25)
                     pixbuf = self.keyboard.get_key_pixbuf(altgr_key)
                     self.lessonbuffer.insert_pixbuf(self.lessonbuffer.get_end_iter(), pixbuf)
                     self.lessonbuffer.insert(self.lessonbuffer.get_end_iter(), ' ')
 
-                pixbuf = self.keyboard.get_key_pixbuf(key, state, group)
+                pixbuf = self.keyboard.get_key_pixbuf(key, state, group, 1.25)
                 self.lessonbuffer.insert_pixbuf(self.lessonbuffer.get_end_iter(), pixbuf)
             
             self.lessonbuffer.apply_tag_by_name('image',
-----------------------------------------------------------------------


--
/home/olpc-code/git/activities/typing-turtle


More information about the Commits mailing list