diff pyink/domview_ui.py @ 1431:60f2c9a24cdb

Keep the same active layer and frame when switching back a timeline. - Add functions to remember frame and layer for timeline at domview. - Recall active frame and layer when calling switch_component() and switch_timeline().
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 11 Apr 2011 00:05:25 +0800
parents f1fa284fc9c9
children 8e8c9ab3818f
line wrap: on
line diff
--- a/pyink/domview_ui.py	Sun Apr 10 20:30:06 2011 +0800
+++ b/pyink/domview_ui.py	Mon Apr 11 00:05:25 2011 +0800
@@ -424,6 +424,9 @@
         self._dom.switch_component(name)
         self._framelines_refresh() # from domview_ui
         self._comp_dock.refresh_timelines()
+        
+        cur_layer_idx, cur_frame_idx = self._dom.get_current_frame()
+        self._fl_stack.active_frame(cur_layer_idx, cur_frame_idx)
         pass
 
     def all_comp_names(self):
@@ -450,6 +453,9 @@
     def switch_timeline(self, name):
         self._dom.switch_timeline(name)
         self._framelines_refresh() # from domview_ui
+        
+        cur_layer_idx, cur_frame_idx = self._dom.get_current_frame()
+        self._fl_stack.active_frame(cur_layer_idx, cur_frame_idx)
         pass
 
     def all_timeline_names(self):
@@ -876,6 +882,13 @@
 	max_frame = self._dom.get_max_frame()
 	return max_frame
 
+    def remember_current_frame(self, layer_idx, frame_idx):
+        self._dom.remember_current_frame(layer_idx, frame_idx)
+        pass
+
+    def get_current_frame(self):
+        return self._dom.get_current_frame()
+
     ## \brief add the current position to the undo buffer.
     #
     #  The msg will be displayed in the UI to indicate the undo set.