You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.0 KiB

9 years ago
from kivy.factory import Factory
from kivy.lang import Builder
Builder.load_string('''
<QRDialog@Popup>
id: popup
title: ''
data: ''
9 years ago
shaded: False
AnchorLayout:
anchor_x: 'center'
BoxLayout:
orientation: 'vertical'
size_hint: 1, 1
QRCodeWidget:
id: qr
TopLabel:
text: root.data
9 years ago
Widget:
size_hint: 1, 0.2
BoxLayout:
size_hint: 1, None
height: '48dp'
Widget:
size_hint: 1, None
height: '48dp'
Button:
size_hint: 1, None
height: '48dp'
text: _('Close')
on_release:
popup.dismiss()
''')
class QRDialog(Factory.Popup):
def __init__(self, title, data):
Factory.Popup.__init__(self)
self.title = title
self.data = data
def on_open(self):
self.ids.qr.set_data(self.data)