diff cagou/kv/xmlui.kv @ 241:661b9cf7b4e4

xmlui: scroll/size fixes: - VerticalContainer and TabsPanelContainer are now put in ScrollView - the height hack in TabsContainer has been removed has it is not needed anymore (minimum_height is now available) - remove the empty widget which was added at the end of main panel, it's better to have the UI taking the whole container height - fixed height for TextWidget,LabelWidget and JidWidget - better scrollbar for VerticalContainer and TabsPanelContainer
author Goffi <goffi@goffi.org>
date Thu, 03 Jan 2019 10:42:43 +0100
parents ca86954b3788
children d535446fdf45
line wrap: on
line diff
--- a/cagou/kv/xmlui.kv	Sat Oct 06 09:48:52 2018 +0200
+++ b/cagou/kv/xmlui.kv	Thu Jan 03 10:42:43 2019 +0100
@@ -20,13 +20,19 @@
 <Title>:
     color: 1, 1, 1, 1
 
-
-<EmptyWidget,TextWidget,LabelWidget,JidWidget,StringWidget,PasswordWidget,JidInputWidget>:
+<EmptyWidget,StringWidget,PasswordWidget,JidInputWidget>:
     size_hint: 1, None
     height: dp(common_height)
     color: 1, 1, 1, 1
 
 
+<TextWidget,LabelWidget,JidWidget>:
+    size_hint: 1, None
+    text_size: self.width, None
+    height: max(dp(common_height), self.texture_size[1])
+    color: 1, 1, 1, 1
+
+
 <StringWidget,PasswordWidget,IntWidget>:
     multiline: False
     background_normal: app.expand('atlas://data/images/defaulttheme/textinput')
@@ -92,8 +98,16 @@
 
 
 <VerticalContainer>:
-    size_hint: 1, None
-    height: self.minimum_height
+    size_hint: 1, 1
+    layout: layout
+    do_scroll_x: False
+    scroll_type: ['bars', 'content']
+    bar_width: dp(6)
+    BoxLayout:
+        id: layout
+        orientation: "vertical"
+        size_hint: 1, None
+        height: self.minimum_height
 
 
 <PairsContainer>:
@@ -103,7 +117,19 @@
 
 
 <TabsContainer>:
-    size_hint: 1, None
+    size_hint: 1, 1
+
+<TabsPanelContainer>:
+    layout: layout
+    ScrollView:
+        do_scroll_x: False
+        scroll_type: ['bars', 'content']
+        bar_width: dp(6)
+        BoxLayout:
+            id: layout
+            orientation: "vertical"
+            size_hint: 1, None
+            height: self.minimum_height
 
 <FormButton>:
     size_hint: 1, None
@@ -134,7 +160,8 @@
 
 
 <XMLUIPanel>:
-    height: self.minimum_height
+    orientation: "vertical"
+    size_hint: 1, 1
     canvas.before:
         Color:
             rgba: 0, 0, 0, 1