diff options
author | Gonzalo Odiard <gonzalo@nautilus.localdomain> | 2010-06-09 18:09:35 (GMT) |
---|---|---|
committer | Gonzalo Odiard <gonzalo@nautilus.localdomain> | 2010-06-09 18:09:35 (GMT) |
commit | 16424ccf036cce9be9a5472b1d889fc86fee5b72 (patch) | |
tree | 5211a59d5a8adc0ee2ce65a0b8200d219ac83698 /OficinaActivity.py | |
parent | af13d4a80f519b2e529702c6158b2258b6570c0f (diff) |
iplements OLPC #8865 - Slider bar should change brush and line width
Connects XO-1 and XO-1.5 slider function keys to line size change for
pencil, eraser, brush and rainbow. The size change is relative to
current size.
Diffstat (limited to 'OficinaActivity.py')
-rw-r--r-- | OficinaActivity.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/OficinaActivity.py b/OficinaActivity.py index 332f198..c72576a 100644 --- a/OficinaActivity.py +++ b/OficinaActivity.py @@ -117,6 +117,8 @@ class OficinaActivity(activity.Activity): self.set_toolbox(toolbox) toolbox.show() + self.connect("key_press_event", self.key_press) + # setup self.area only once def map_cp(widget): @@ -131,6 +133,11 @@ class OficinaActivity(activity.Activity): self._setup_handle = self.connect('map', map_cp) + def key_press(self, widget, event): + sliders = {65474: -5, 65475: -1, 65476: 1, 65477: 5} + if event.keyval in sliders: + self.area.change_line_size(sliders[event.keyval]) + def read_file(self, file_path): '''Read file from Sugar Journal.''' |