1
0

kivy: improve ref label and QR codes

This commit is contained in:
ThomasV
2016-02-18 13:53:23 +01:00
parent 34ddaaa419
commit 74a822ae56
6 changed files with 29 additions and 21 deletions

View File

@@ -7,15 +7,18 @@ Builder.load_string('''
title: ''
data: ''
shaded: False
show_text: False
AnchorLayout:
anchor_x: 'center'
BoxLayout:
orientation: 'vertical'
size_hint: 1, 1
padding: '10dp'
spacing: '10dp'
QRCodeWidget:
id: qr
TopLabel:
text: root.data
text: root.data if root.show_text else ''
Widget:
size_hint: 1, 0.2
BoxLayout:
@@ -33,10 +36,11 @@ Builder.load_string('''
''')
class QRDialog(Factory.Popup):
def __init__(self, title, data):
def __init__(self, title, data, show_text):
Factory.Popup.__init__(self)
self.title = title
self.data = data
self.show_text = show_text
def on_open(self):
self.ids.qr.set_data(self.data)

View File

@@ -62,8 +62,8 @@ Builder.load_string('''
TopLabel:
text: _('Transaction ID') + ':' if root.tx_hash else ''
TxHashLabel:
tx_hash: root.tx_hash
data: root.tx_hash
name: _('Transaction ID')
Widget:
size_hint: 1, 0.1