Mercurial > libervia-desktop-kivy
comparison cagou/core/widgets_handler.py @ 362:e1f56257cabc
core (widgets handler): use widget set in set_widget as selected_widget if selected_widget is None
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 27 Jan 2020 21:17:08 +0100 |
parents | 8b6621cc142c |
children | 9c6fe392d623 |
comparison
equal
deleted
inserted
replaced
361:f20ec8462493 | 362:e1f56257cabc |
---|---|
611 | 611 |
612 def add_widget(self, wid=None, index=0): | 612 def add_widget(self, wid=None, index=0): |
613 WidgetsHandlerLayout.count += 1 | 613 WidgetsHandlerLayout.count += 1 |
614 if wid is None: | 614 if wid is None: |
615 wid = self.default_widget | 615 wid = self.default_widget |
616 if G.host.selected_widget is None: | |
617 G.host.selected_widget = wid | |
616 wrapper = WHWrapper(_wid_idx=WidgetsHandlerLayout.count) | 618 wrapper = WHWrapper(_wid_idx=WidgetsHandlerLayout.count) |
617 log.debug("WHWrapper created ({})".format(wrapper._wid_idx)) | 619 log.debug("WHWrapper created ({})".format(wrapper._wid_idx)) |
618 wrapper.set_widget(wid) | 620 wrapper.set_widget(wid) |
619 super(WidgetsHandlerLayout, self).add_widget(wrapper, index) | 621 super(WidgetsHandlerLayout, self).add_widget(wrapper, index) |
620 return wrapper | 622 return wrapper |