kivy: fix scrollview in choice_dialog

This commit is contained in:
ThomasV 2016-01-21 07:19:22 +01:00
parent b878c010da
commit 5502cab796
1 changed files with 6 additions and 4 deletions

View File

@ -24,7 +24,7 @@ Builder.load_string('''
orientation: 'vertical'
id: choices
cols: 2
size_hint: 1, 1
size_hint: 1, None
BoxLayout:
orientation: 'horizontal'
size_hint: 1, 0.2
@ -46,6 +46,8 @@ class ChoiceDialog(Factory.Popup):
def __init__(self, title, choices, key, callback):
Factory.Popup.__init__(self)
layout = self.ids.choices
layout.bind(minimum_height=layout.setter('height'))
for k, v in choices.items():
l = Label(text=v)
l.height = '48dp'
@ -57,9 +59,9 @@ class ChoiceDialog(Factory.Popup):
cb.bind(active=f)
if k == key:
cb.active = True
self.ids.choices.add_widget(l)
self.ids.choices.add_widget(cb)
self.ids.choices.add_widget(Widget(size_hint_y=1))
layout.add_widget(l)
layout.add_widget(cb)
layout.add_widget(Widget(size_hint_y=1))
self.callback = callback
self.title = title
self.value = key