Skip to content
Snippets Groups Projects
Commit 99404904 authored by dos's avatar dos Committed by ave
Browse files

py,st3m: ViewManager: Add transitioning property

Views may want to wait with heavy loading tasks until transition
is done for smooth UX.
parent e7e93518
No related branches found
No related tags found
No related merge requests found
......@@ -218,6 +218,9 @@ class ViewManager(Responder):
The new view will _not_ be added to history!
"""
self._transitioning = True
self._transition = 0.0
self._outgoing = self._incoming
if self._outgoing is not None:
self._outgoing.on_exit()
......@@ -225,10 +228,7 @@ class ViewManager(Responder):
self._incoming.on_enter(self)
self._overriden_vt = overide_vt
if self._outgoing is None:
return
self._transitioning = True
self._transition = 0.0
self._transition = 1.0
def push(self, r: View, override_vt: Optional[ViewTransition] = None) -> None:
"""
......@@ -269,3 +269,10 @@ class ViewManager(Responder):
Returns true if the passed view is currently the active one.
"""
return self._incoming == view
@property
def transitioning(self) -> bool:
"""
Returns true if a transition is in progress.
"""
return self._transitioning
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment