diff options
author | Daniel Francis <francis@sugarlabs.org> | 2012-07-16 17:42:08 (GMT) |
---|---|---|
committer | Daniel Francis <francis@sugarlabs.org> | 2012-07-16 17:42:08 (GMT) |
commit | c5857a8fbf9fb356e8d6f99cff1e0c986a0ce0ee (patch) | |
tree | b7ea1978be1a590b033b448f123e3a22667c0538 | |
parent | eb26495611bbc8d38637d822343689af1c8bf1a4 (diff) |
Update image preview
-rw-r--r-- | activity.py | 9 | ||||
-rw-r--r-- | animation.py | 5 |
2 files changed, 8 insertions, 6 deletions
diff --git a/activity.py b/activity.py index 21f836e..56f3af3 100644 --- a/activity.py +++ b/activity.py @@ -159,13 +159,13 @@ class AnimateActivity(activity.Activity): self._animation.set_fps(fps) def _set_return_mode(self, widget): - self._animation.set_mode(animation.RETURN_MODE) + self._animation.set_mode(animation.MODE_RETURN) def _set_normal_mode(self, widget): - self._animation.set_mode(animation.NORMAL_MODE) + self._animation.set_mode(animation.MODE_NORMAL) def _set_pingpong_mode(self, widget): - self._animation.set_mode(animation.PING_PONG_MODE) + self._animation.set_mode(animation.MODE_PING_PONG) def _previous_frame(self, widget): self._animation.back() @@ -209,12 +209,13 @@ class AnimateActivity(activity.Activity): del self._animation_mode - canvas.pack_start(self._animation, True, True, 0) + canvas.pack_start(self._animation, True, True, 0) def _current_frame_updated_cb(self, widget, index): if widget.frames_reverse: index = len(widget.frames) - 1 - index self._frames_list.select_frame(index) + return index def _view_fullscreen(self, widget): self._frames_list.hide() diff --git a/animation.py b/animation.py index 83d33b1..a0818a8 100644 --- a/animation.py +++ b/animation.py @@ -51,7 +51,7 @@ class Animation(gtk.Image): gobject.PARAM_READWRITE)} __gsignals__ = {"current-frame-updated": (gobject.SIGNAL_RUN_LAST, - gobject.TYPE_NONE, + gobject.TYPE_INT, (gobject.TYPE_INT,))} def __init__(self, width, height, fps=2): @@ -193,7 +193,8 @@ class Animation(gtk.Image): else: self._current_frame = 0 - self.emit("current-frame-updated", self._current_frame) + pos = self.emit("current-frame-updated", self._current_frame) + self.set_current_frame(pos) return True |