kivy: fix scrollview in choice_dialog
This commit is contained in:
parent
b878c010da
commit
5502cab796
|
@ -24,7 +24,7 @@ Builder.load_string('''
|
||||||
orientation: 'vertical'
|
orientation: 'vertical'
|
||||||
id: choices
|
id: choices
|
||||||
cols: 2
|
cols: 2
|
||||||
size_hint: 1, 1
|
size_hint: 1, None
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
orientation: 'horizontal'
|
orientation: 'horizontal'
|
||||||
size_hint: 1, 0.2
|
size_hint: 1, 0.2
|
||||||
|
@ -46,6 +46,8 @@ class ChoiceDialog(Factory.Popup):
|
||||||
|
|
||||||
def __init__(self, title, choices, key, callback):
|
def __init__(self, title, choices, key, callback):
|
||||||
Factory.Popup.__init__(self)
|
Factory.Popup.__init__(self)
|
||||||
|
layout = self.ids.choices
|
||||||
|
layout.bind(minimum_height=layout.setter('height'))
|
||||||
for k, v in choices.items():
|
for k, v in choices.items():
|
||||||
l = Label(text=v)
|
l = Label(text=v)
|
||||||
l.height = '48dp'
|
l.height = '48dp'
|
||||||
|
@ -57,9 +59,9 @@ class ChoiceDialog(Factory.Popup):
|
||||||
cb.bind(active=f)
|
cb.bind(active=f)
|
||||||
if k == key:
|
if k == key:
|
||||||
cb.active = True
|
cb.active = True
|
||||||
self.ids.choices.add_widget(l)
|
layout.add_widget(l)
|
||||||
self.ids.choices.add_widget(cb)
|
layout.add_widget(cb)
|
||||||
self.ids.choices.add_widget(Widget(size_hint_y=1))
|
layout.add_widget(Widget(size_hint_y=1))
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
self.title = title
|
self.title = title
|
||||||
self.value = key
|
self.value = key
|
||||||
|
|
Loading…
Reference in New Issue