comparison src/cagou/core/cagou_main.py @ 52:647f32d0a004

core: workaround issue happening when root widget is changed too quickly (during a transition)
author Goffi <goffi@goffi.org>
date Sun, 11 Sep 2016 23:24:07 +0200
parents 3f8599d9a766
children 35abe494e6c7
comparison
equal deleted inserted replaced
51:3f8599d9a766 52:647f32d0a004
156 self._manager.add_widget(xmlui_screen) 156 self._manager.add_widget(xmlui_screen)
157 self.add_widget(self._manager) 157 self.add_widget(self._manager)
158 158
159 def changeWidget(self, widget, screen_name="main"): 159 def changeWidget(self, widget, screen_name="main"):
160 """change main widget""" 160 """change main widget"""
161 if self._manager.transition.is_active:
162 # FIXME: workaround for what seems a Kivy bug
163 # TODO: report this upstream
164 self._manager.transition.stop()
161 screen = self._manager.get_screen(screen_name) 165 screen = self._manager.get_screen(screen_name)
162 screen.clear_widgets() 166 screen.clear_widgets()
163 screen.add_widget(widget) 167 screen.add_widget(widget)
164 168
165 def show(self, screen="main"): 169 def show(self, screen="main"):
170 if self._manager.transition.is_active:
171 # FIXME: workaround for what seems a Kivy bug
172 # TODO: report this upstream
173 self._manager.transition.stop()
166 if self._manager.current == screen: 174 if self._manager.current == screen:
167 return 175 return
168 if screen == "main": 176 if screen == "main":
169 self._manager.transition = FallOutTransition() 177 self._manager.transition = FallOutTransition()
170 else: 178 else: