kivy tx dialog: move buttons out of scrollview

This commit is contained in:
ThomasV 2016-02-17 16:40:31 +01:00
parent 54897c84f8
commit f67162c79d
1 changed files with 72 additions and 69 deletions

View File

@ -22,84 +22,87 @@ Builder.load_string('''
status_str: '' status_str: ''
description: '' description: ''
outputs_str: '' outputs_str: ''
ScrollView: BoxLayout:
GridLayout: orientation: 'vertical'
height: self.minimum_height ScrollView:
size_hint_y: None
cols: 1
spacing: '10dp'
padding: '10dp'
GridLayout: GridLayout:
height: self.minimum_height height: self.minimum_height
size_hint_y: None size_hint_y: None
cols: 2 cols: 1
spacing: '10dp' spacing: '10dp'
padding: '10dp'
GridLayout:
height: self.minimum_height
size_hint_y: None
cols: 2
spacing: '10dp'
TopLabel:
text: _('Status')
TopLabel:
text: root.status_str
TopLabel:
text: _('Description') if root.description else ''
TopLabel:
text: root.description
TopLabel:
text: _('Date') if root.date_str else ''
TopLabel:
text: root.date_str
TopLabel:
text: _('Amount sent') if root.is_mine else _('Amount received')
TopLabel:
text: root.amount_str
TopLabel:
text: _('Transaction fee') if root.fee_str else ''
TopLabel:
text: root.fee_str
TopLabel: TopLabel:
text: _('Status') text: _('Outputs') + ':'
OutputList:
height: self.minimum_height
size_hint: 1, None
id: output_list
TopLabel: TopLabel:
text: root.status_str text: _('Transaction ID') + ':' if root.tx_hash else ''
TopLabel: TopLabel:
text: _('Description') if root.description else '' font_size: '6pt'
TopLabel: text: '[ref=x]%s[/ref]' %' '.join(map(''.join, zip(*[iter(root.tx_hash)]*4))) if root.tx_hash else ''
text: root.description padding: '10dp', '10dp'
TopLabel: on_ref_press:
text: _('Date') if root.date_str else '' app._clipboard.copy(self.text)
TopLabel: app.show_info(_('Transaction ID copied to clipboard'))
text: root.date_str canvas.before:
TopLabel: Color:
text: _('Amount sent') if root.is_mine else _('Amount received') rgb: .3, .3, .3
TopLabel: Rectangle:
text: root.amount_str size: self.size
TopLabel: pos: self.pos
text: _('Transaction fee') if root.fee_str else ''
TopLabel:
text: root.fee_str
TopLabel:
text: _('Outputs') + ':'
OutputList:
height: self.minimum_height
size_hint: 1, None
id: output_list
TopLabel:
text: _('Transaction ID') + ':' if root.tx_hash else ''
TopLabel:
font_size: '6pt'
text: '[ref=x]%s[/ref]' %' '.join(map(''.join, zip(*[iter(root.tx_hash)]*4))) if root.tx_hash else ''
padding: '10dp', '10dp'
on_ref_press:
app._clipboard.copy(self.text)
app.show_info(_('Transaction ID copied to clipboard'))
canvas.before:
Color:
rgb: .3, .3, .3
Rectangle:
size: self.size
pos: self.pos
#Widget:
# size_hint: 1, 0.2
BoxLayout: Widget:
size_hint: 1, None size_hint: 1, 0.1
BoxLayout:
size_hint: 1, None
height: '48dp'
Button:
size_hint: 0.5, None
height: '48dp' height: '48dp'
Button: text: _('Sign') if root.can_sign else _('Broadcast') if root.can_broadcast else ''
size_hint: 0.5, None opacity: 1 if root.can_sign or root.can_broadcast else 0
height: '48dp' disabled: not( root.can_sign or root.can_broadcast )
text: _('Sign') if root.can_sign else _('Broadcast') if root.can_broadcast else '' on_release:
opacity: 1 if root.can_sign or root.can_broadcast else 0 if root.can_sign: root.do_sign()
disabled: not( root.can_sign or root.can_broadcast ) if root.can_broadcast: root.do_broadcast()
on_release: IconButton:
if root.can_sign: root.do_sign() size_hint: 0.5, None
if root.can_broadcast: root.do_broadcast() height: '48dp'
IconButton: icon: 'atlas://gui/kivy/theming/light/qrcode'
size_hint: 0.5, None on_release: root.show_qr()
height: '48dp' Button:
icon: 'atlas://gui/kivy/theming/light/qrcode' size_hint: 0.5, None
on_release: root.show_qr() height: '48dp'
Button: text: _('Close')
size_hint: 0.5, None on_release: popup.dismiss()
height: '48dp'
text: _('Close')
on_release: popup.dismiss()
''') ''')