electrum-bitcoinprivate/gui/kivy/uix/ui_screens/amount.kv

97 lines
3.1 KiB
Plaintext
Raw Normal View History

2015-10-16 05:59:26 -07:00
#:import Decimal decimal.Decimal
2015-10-14 02:44:01 -07:00
Popup:
id: popup
title: _('Amount')
2015-10-16 05:59:26 -07:00
AnchorLayout:
anchor_x: 'center'
2015-10-14 02:44:01 -07:00
2015-10-16 02:18:24 -07:00
BoxLayout:
2015-10-16 05:59:26 -07:00
orientation: 'vertical'
size_hint: 0.8, 1
BoxLayout:
2015-12-02 10:25:07 -08:00
size_hint: 1, 1
2015-10-14 06:13:47 -07:00
height: '48dp'
2015-10-16 05:59:26 -07:00
Label:
id: a
btc_text: (kb.amount + ' ' + app.base_unit) if kb.amount else ''
fiat_text: (kb.fiat_amount + ' ' + app.fiat_unit) if kb.fiat_amount else ''
text: (self.fiat_text + ' / ' + self.btc_text if kb.is_fiat else self.btc_text + ' / ' + self.fiat_text) if self.btc_text else ''
2015-12-02 10:25:07 -08:00
size_hint: 1, 1
2015-10-16 05:59:26 -07:00
Widget:
size_hint: 1, 1
GridLayout:
id: kb
amount: ''
fiat_amount: ''
is_fiat: False
on_fiat_amount: if self.is_fiat: self.amount = app.fiat_to_btc(self.fiat_amount)
on_amount: if not self.is_fiat: self.fiat_amount = app.btc_to_fiat(self.amount)
update_text: app.update_amount
2015-10-16 05:59:26 -07:00
size_hint: 1, None
height: '300dp'
cols: 3
KButton:
text: '1'
KButton:
text: '2'
KButton:
text: '3'
KButton:
text: '4'
KButton:
text: '5'
KButton:
text: '6'
KButton:
text: '7'
KButton:
text: '8'
KButton:
text: '9'
KButton:
text: '.'
KButton:
text: '0'
KButton:
text: '<'
Button:
id: but_max
size_hint: 1, None
height: '48dp'
text: 'Max'
2015-12-05 09:14:17 -08:00
on_release:
kb.is_fiat = False
kb.amount = app.get_max_amount()
2015-12-02 10:25:07 -08:00
Button:
id: button_fiat
size_hint: 1, None
height: '48dp'
text: app.fiat_unit if kb.is_fiat else app.base_unit
on_release:
app.toggle_fiat(kb)
2015-12-02 10:25:07 -08:00
Button:
size_hint: 1, None
height: '48dp'
text: 'Clear'
on_release:
kb.amount = ''
kb.fiat_amount = ''
2015-12-02 09:02:11 -08:00
Widget:
size_hint: 1, None
2015-10-16 05:59:26 -07:00
BoxLayout:
size_hint: 1, None
height: '48dp'
Widget:
2015-12-02 10:25:07 -08:00
size_hint: 2, None
2015-10-16 05:59:26 -07:00
height: '48dp'
Button:
2015-12-02 09:02:11 -08:00
size_hint: 1, None
2015-10-16 05:59:26 -07:00
height: '48dp'
text: _('OK')
on_release: popup.dismiss()