diff options
author | Manuel Quiñones <manuq@laptop.org> | 2013-02-14 18:27:21 (GMT) |
---|---|---|
committer | Manuel Quiñones <manuq@laptop.org> | 2013-02-27 23:31:10 (GMT) |
commit | 89efa8ddca2176b25f485293e834fecf579612c7 (patch) | |
tree | fe2cd762dcd0bb46aa8bfa2f37c495e337ea1f6f | |
parent | 3beda36d80dea3ab86d8a2a184d9cc7f89d1d7fc (diff) |
Add toolbutton for the grab hands feature - SL #1959
This is just the button, no functionality added to it.
- New icon grab.svg, stolen from Physics activity
- Add button next to the speak one
- Disable grab making the button insensitive when the clock is digital
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
-rwxr-xr-x | clock.py | 17 | ||||
-rw-r--r-- | icons/grab.svg | 7 |
2 files changed, 24 insertions, 0 deletions
@@ -310,6 +310,12 @@ class ClockActivity(activity.Activity): button.connect("toggled", self._speak_time_clicked_cb) display_toolbar.insert(button, -1) + # And another button to toggle grabbing the hands + self._grab_button = ToggleToolButton("grab") + self._grab_button.set_tooltip(_('Grab the hands')) + self._grab_button.connect("toggled", self._grab_clicked_cb) + display_toolbar.insert(self._grab_button, -1) + def _make_display(self): """Prepare the display of the clock. @@ -360,6 +366,10 @@ class ClockActivity(activity.Activity): """ self._clock.set_display_mode(display_mode) + # The hands can't be grabbed in the digital clock mode + is_digital = display_mode == _MODE_DIGITAL_CLOCK + self._grab_button.props.sensitive = not is_digital + def _write_time_clicked_cb(self, button): """The user clicked on the "write time" button to print the current time. @@ -379,6 +389,13 @@ class ClockActivity(activity.Activity): if self._speak_time: self._write_and_speak(True) + def _grab_clicked_cb(self, button): + """The user clicked on the "grab hands" button to toggle + grabbing the hands. + """ + # FIXME: implement + pass + def _minutes_changed_cb(self, clock): """Minutes have changed on the clock face: we have to update the display of the time in full letters if the user has chosen diff --git a/icons/grab.svg b/icons/grab.svg new file mode 100644 index 0000000..3163347 --- /dev/null +++ b/icons/grab.svg @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [ + <!ENTITY fill_color "#FFFFFF"> + <!ENTITY stroke_color "#FFFFFF"> +]> +<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50"> +<path d="M11,18 Q13,16 15,19 L15,31 Q16,33 17,31 L17,7 Q19,5 21,7 L21,25 Q22,27 23,25 L23,7 Q25,5 27,7 L27,25 Q28,27 29,25 L29,7 Q31,5 33,7 L33,25 Q34,27 35,25 L35,12 Q37,10 39,12 L39,37 Q39,44 33,45 L17,45 Q11,45 11,37" style="fill:&fill_color;;stroke:&stroke_color;;stroke-width:.3"/></svg> |