From 084b894ee7629630d5c0106b043ae3a402c02496 Mon Sep 17 00:00:00 2001 From: Qua-non Date: Wed, 25 Jan 2012 04:12:31 +0530 Subject: [PATCH] add tab transition animation in the example --- examples/widgets/tabbed_panel_test.py | 14 ++++++++++++-- kivy/uix/tabbedpannel.py | 6 +----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/examples/widgets/tabbed_panel_test.py b/examples/widgets/tabbed_panel_test.py index 1c7c5ddcd..5b7a7bb5c 100644 --- a/examples/widgets/tabbed_panel_test.py +++ b/examples/widgets/tabbed_panel_test.py @@ -6,12 +6,14 @@ Test of the widget TabbedPannel. ''' from kivy.app import App -from kivy.uix.floatlayout import FloatLayout +from kivy.animation import Animation +from kivy.clock import Clock from kivy.uix.button import Button -from kivy.lang import Builder +from kivy.uix.floatlayout import FloatLayout from kivy.uix.tabbedpannel import TabbedPannel from kivy.properties import ObjectProperty +from kivy.lang import Builder Builder.load_string(''' size_hint: (None, None) @@ -54,8 +56,16 @@ class cut_copy_paste(TabbedPannel): self.change_tab_contents(self.default_content) def change_tab_contents(self, *l): + anim = Animation( color=(1, 1, 1, 0), d =.27, t = 'in_back') + + def start_anim(*l): + anim.start(self.content.children[0]) + + start_anim() self.clear_widgets() self.add_widget(l[0]) + anim = Animation( color = (1, 1, 1, 1), d =.27, t = 'in_quad') + start_anim() class TabShowcase(FloatLayout): diff --git a/kivy/uix/tabbedpannel.py b/kivy/uix/tabbedpannel.py index eb4910a8c..59eb5a5a7 100644 --- a/kivy/uix/tabbedpannel.py +++ b/kivy/uix/tabbedpannel.py @@ -2,7 +2,7 @@ TabbedPannel ============ -.. versionadded:: 1.0.1? +.. versionadded:: 1.0.10 .. image:: images/tabbed_pannel.jpg :align: right @@ -100,10 +100,6 @@ by default The tab strip takes it's background image, color from the TabbedPannel's background_image and background_color respectively. ''' -#TODO: overall percentage done[====-]% -# animation -#change added version[====-]% -# move load_string to style.kv __all__ = ('TabbedPannel', 'Tab_Content', 'Tab_Heading', 'Tab_Strip')