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
|
|
|
|
amount: ''
|
2015-12-03 13:43:43 -08:00
|
|
|
fiat_amount: ''
|
2015-12-02 03:11:28 -08:00
|
|
|
is_fiat: False
|
2015-12-03 13:43:43 -08:00
|
|
|
btc_text: app.fiat_to_btc(self.fiat_amount) if self.is_fiat else (self.amount + ' ' + app.base_unit if self.amount else '')
|
|
|
|
fiat_text: (self.fiat_amount + ' ' + app.fiat_unit if self.fiat_amount else '') if self.is_fiat else app.btc_to_fiat(self.amount)
|
|
|
|
text: (self.fiat_text + ' / ' + self.btc_text if self.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
|
2015-10-14 02:44:01 -07:00
|
|
|
|
2015-10-16 05:59:26 -07:00
|
|
|
GridLayout:
|
|
|
|
size_hint: 1, None
|
|
|
|
height: '300dp'
|
|
|
|
cols: 3
|
|
|
|
KButton:
|
|
|
|
text: '1'
|
|
|
|
label: a
|
|
|
|
KButton:
|
|
|
|
text: '2'
|
|
|
|
label: a
|
|
|
|
KButton:
|
|
|
|
text: '3'
|
|
|
|
label: a
|
|
|
|
KButton:
|
|
|
|
text: '4'
|
|
|
|
label: a
|
|
|
|
KButton:
|
|
|
|
text: '5'
|
|
|
|
label: a
|
|
|
|
KButton:
|
|
|
|
text: '6'
|
|
|
|
label: a
|
|
|
|
KButton:
|
|
|
|
text: '7'
|
|
|
|
label: a
|
|
|
|
KButton:
|
|
|
|
text: '8'
|
|
|
|
label: a
|
|
|
|
KButton:
|
|
|
|
text: '9'
|
|
|
|
label: a
|
|
|
|
KButton:
|
|
|
|
text: '.'
|
|
|
|
label: a
|
|
|
|
KButton:
|
|
|
|
text: '0'
|
|
|
|
label: a
|
|
|
|
KButton:
|
|
|
|
text: '<'
|
|
|
|
label: a
|
2015-10-30 06:34:15 -07:00
|
|
|
Button:
|
2015-10-30 07:11:54 -07:00
|
|
|
id: but_max
|
2015-10-30 06:34:15 -07:00
|
|
|
size_hint: 1, None
|
|
|
|
height: '48dp'
|
|
|
|
text: 'Max'
|
2015-12-05 09:14:17 -08:00
|
|
|
on_release:
|
|
|
|
a.is_fiat = False
|
|
|
|
a.amount = app.get_max_amount()
|
2015-12-02 10:25:07 -08:00
|
|
|
Button:
|
|
|
|
id: button_fiat
|
|
|
|
size_hint: 1, None
|
|
|
|
height: '48dp'
|
2015-12-05 09:14:17 -08:00
|
|
|
text: app.fiat_unit if a.is_fiat else app.base_unit
|
2015-12-03 13:43:43 -08:00
|
|
|
on_release:
|
|
|
|
app.toggle_fiat(a)
|
2015-12-02 10:25:07 -08:00
|
|
|
Button:
|
|
|
|
size_hint: 1, None
|
|
|
|
height: '48dp'
|
|
|
|
text: 'Clear'
|
2015-12-03 13:43:43 -08:00
|
|
|
on_release:
|
|
|
|
a.amount = ''
|
|
|
|
a.fiat_amount = ''
|
2015-10-30 06:34:15 -07:00
|
|
|
|
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()
|