Mercurial > libervia-desktop-kivy
changeset 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 | 976f22cb3ecc |
children | 916af9c1cb9b |
files | cagou/core/xmlui.py cagou/kv/xmlui.kv |
diffstat | 2 files changed, 4 insertions(+), 22 deletions(-) [+] |
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
--- a/cagou/kv/xmlui.kv Sat Apr 28 08:57:51 2018 +0200 +++ b/cagou/kv/xmlui.kv Sat Apr 28 10:43:54 2018 +0200 @@ -78,7 +78,6 @@ <VerticalContainer>: - cols: 1 size_hint: 1, None height: self.minimum_height @@ -91,8 +90,6 @@ <TabsContainer>: size_hint: 1, None - height: 100 - <FormButton>: size_hint: 1, None @@ -129,9 +126,3 @@ Rectangle: pos: self.pos size: self.size - - -<XMLUIPanelGrid>: - cols: 1 - size_hint: 1, None - height: self.minimum_height