diff --git a/kivy/uix/screenmanager.py b/kivy/uix/screenmanager.py index 44ac86b9e..1ae8789b0 100644 --- a/kivy/uix/screenmanager.py +++ b/kivy/uix/screenmanager.py @@ -925,6 +925,7 @@ class ScreenManager(FloatLayout): raise ScreenManagerException( 'ScreenManager accepts only Screen widget.') + # stop any transition that might be happening already self.transition.stop() @@ -933,6 +934,12 @@ class ScreenManager(FloatLayout): if self.has_screen(screen.name): screen.name = self._generate_screen_name() + # change the transition if given explicitly + old_transition = self.transition + specified_transition = options.pop("transition", None) + if specified_transition: + self.transition = specified_transition + # change the transition options for key, value in iteritems(options): setattr(self.transition, key, value) @@ -947,6 +954,7 @@ class ScreenManager(FloatLayout): def remove_old_screen(transition): if old_current in self.children: self.remove_widget(old_current) + self.transition = old_transition transition.unbind(on_complete=remove_old_screen) self.transition.bind(on_complete=remove_old_screen)