Mercurial > MadButterfly
comparison pyink/domview.py @ 1344:8f1f8ef5c9ea
Hide scene groups of old timeline when switching to a new timeline.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Wed, 09 Feb 2011 07:07:08 +0800 |
parents | c2fbae4f0adc |
children | e0400a2b7c35 |
comparison
equal
deleted
inserted
replaced
1343:c2fbae4f0adc | 1344:8f1f8ef5c9ea |
---|---|
530 comp_group = self._domview.get_node(gid) | 530 comp_group = self._domview.get_node(gid) |
531 return comp_group | 531 return comp_group |
532 | 532 |
533 def get_current_component(self): | 533 def get_current_component(self): |
534 return self._cur_comp.name() | 534 return self._cur_comp.name() |
535 | |
536 ## \brief Hide scene groups of current timeline. | |
537 # | |
538 # This method all scene groups of current timeline invisible. | |
539 # | |
540 def _hide_current_timeline(self): | |
541 tl = self._cur_timeline | |
542 scenes_node = tl.scenes_node | |
543 for child in scenes_node.childList(): | |
544 if child.name() != 'ns0:scene': | |
545 continue | |
546 gid = child.getAttribute('ref') | |
547 group = self._domview.get_node(gid) | |
548 group.setAttribute('style', 'display: none') | |
549 pass | |
550 pass | |
535 | 551 |
536 def switch_timeline(self, timeline_name): | 552 def switch_timeline(self, timeline_name): |
553 if self._cur_timeline: | |
554 self._hide_current_timeline() | |
555 pass | |
556 | |
537 tl = self._cur_comp.get_timeline(timeline_name) | 557 tl = self._cur_comp.get_timeline(timeline_name) |
538 self._cur_timeline = tl | 558 self._cur_timeline = tl |
539 self._domview._scenes_node = tl.scenes_node # of class domview | 559 self._domview._scenes_node = tl.scenes_node # of class domview |
540 | 560 |
541 # Make domview to rescan layers and scenes. | 561 # Make domview to rescan layers and scenes. |