Mercurial > libervia-desktop-kivy
diff cagou/core/xmlui.py @ 159:8ed389d15690
xmlui: fixes:
- removed global ScrollView as it was conflicting with TabbedPanel, resulting in unusable settings
- replaced GridLayout by BoxLayout when suitable, as they now handle minimum_height
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 28 Apr 2018 10:43:54 +0200 |
parents | 0704f3be65cb |
children | 37638765c97b |
line wrap: on
line diff
--- a/cagou/core/xmlui.py Sat Apr 28 08:57:51 2018 +0200 +++ b/cagou/core/xmlui.py Sat Apr 28 10:43:54 2018 +0200 @@ -22,7 +22,6 @@ from sat.core.log import getLogger log = getLogger(__name__) from sat_frontends.tools import xmlui -from kivy.uix.scrollview import ScrollView from kivy.uix.boxlayout import BoxLayout from kivy.uix.gridlayout import GridLayout from kivy.uix.tabbedpanel import TabbedPanel, TabbedPanelItem @@ -274,11 +273,11 @@ ## Containers ## -class VerticalContainer(xmlui.VerticalContainer, GridLayout): +class VerticalContainer(xmlui.VerticalContainer, BoxLayout): def __init__(self, xmlui_parent): self.xmlui_parent = xmlui_parent - GridLayout.__init__(self) + BoxLayout.__init__(self, orientation="vertical") def _xmluiAppend(self, widget): self.add_widget(widget) @@ -477,18 +476,13 @@ pass -class XMLUIPanelGrid(GridLayout): - pass - -class XMLUIPanel(xmlui.XMLUIPanel, ScrollView): +class XMLUIPanel(xmlui.XMLUIPanel, BoxLayout): widget_factory = WidgetFactory() def __init__(self, host, parsed_xml, title=None, flags=None, callback=None, ignore=None, whitelist=None, profile=C.PROF_KEY_NONE): - ScrollView.__init__(self) + BoxLayout.__init__(self, orientation="vertical") self.close_cb = None - self._grid = XMLUIPanelGrid() self._post_treats = [] # list of callback to call after UI is constructed - ScrollView.add_widget(self, self._grid) xmlui.XMLUIPanel.__init__(self, host, parsed_xml, @@ -499,9 +493,6 @@ whitelist=whitelist, profile=profile) - def add_widget(self, wid): - self._grid.add_widget(wid) - def setCloseCb(self, close_cb): self.close_cb = close_cb