Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2013-03-20 21:01:40 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-03-20 21:12:01 (GMT)
commitfb3e0debaa43311bccef5083f863a12704767c1e (patch)
tree7f367263e5e686394acbe13f7e7fcde177118464
parentb869a952391958afac2c908faa8940854474532b (diff)
Enlarge fonts in notes labels
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r--activity.py6
-rwxr-xr-xdraw_piano.py8
2 files changed, 7 insertions, 7 deletions
diff --git a/activity.py b/activity.py
index 79dc5b3..343a808 100644
--- a/activity.py
+++ b/activity.py
@@ -192,15 +192,15 @@ class SimplePianoActivity(activity.Activity):
self.setInstrument(instrument_name)
def set_notes_labels_cb(self, widget):
- self.piano.font_size = 14
+ self.piano.font_size = 16
self.piano.set_labels(self.notes_labels)
def set_keyboard_labels_cb(self, widget):
- self.piano.font_size = 20
+ self.piano.font_size = 25
self.piano.set_labels(self.keyboard_letters)
def set_german_labels_cb(self, widget):
- self.piano.font_size = 20
+ self.piano.font_size = 25
self.piano.set_labels(self.german_labels)
def enableKeyboard(self):
diff --git a/draw_piano.py b/draw_piano.py
index 93ae6b0..6df9c35 100755
--- a/draw_piano.py
+++ b/draw_piano.py
@@ -13,7 +13,7 @@ import logging
from gi.repository import GObject
from gi.repository import Gtk
from gi.repository import Gdk
-from gi.repository import cairo
+import cairo
# constants used to calculate the draw of black keys
# right now is 4/5 of the white key
@@ -43,7 +43,7 @@ class PianoKeyboard(Gtk.DrawingArea):
if values is not None:
self._values = values
self._pressed_keys = []
- self.font_size = 20
+ self.font_size = 25
self._touches = {}
self._mouse_button_pressed = False
super(PianoKeyboard, self).__init__()
@@ -259,8 +259,8 @@ class PianoKeyboard(Gtk.DrawingArea):
# calculate text height
# TODO:
- #ctx.select_font_face("Sans", cairo.FONT_SLANT_NORMAL,
- # cairo.FONT_WEIGHT_NORMAL)
+ ctx.select_font_face('sans-serif', cairo.FONT_SLANT_NORMAL,
+ cairo.FONT_WEIGHT_BOLD)
ctx.set_font_size(self.font_size)
x_bearing, y_bearing, width, height, x_advance, y_advance = \
ctx.text_extents('M')