3 changed files with 100 additions and 84 deletions
@ -1,79 +1,93 @@ |
|||||||
<KButton@Button>: |
#:import Decimal decimal.Decimal |
||||||
size_hint: 1, None |
|
||||||
height: '38dp' |
|
||||||
|
|
||||||
Popup: |
Popup: |
||||||
id: popup |
id: popup |
||||||
title: _('Amount') |
title: _('Amount') |
||||||
|
|
||||||
BoxLayout: |
AnchorLayout: |
||||||
|
anchor_x: 'center' |
||||||
orientation: 'vertical' |
|
||||||
|
|
||||||
halign: 'center' |
|
||||||
|
|
||||||
BoxLayout: |
BoxLayout: |
||||||
Label: |
orientation: 'vertical' |
||||||
id: amount_label |
size_hint: 0.8, 1 |
||||||
text: '' |
|
||||||
value: '' |
|
||||||
on_value: |
|
||||||
self.text = self.value + ' ' + app.base_unit |
|
||||||
Widget: |
|
||||||
size_hint_x: 1 |
|
||||||
|
|
||||||
GridLayout: |
BoxLayout: |
||||||
cols: 3 |
size_hint: 1, None |
||||||
size_hint: 0.5, 1 |
|
||||||
KButton: |
|
||||||
text: '1' |
|
||||||
on_release: amount_label.value += self.text |
|
||||||
KButton: |
|
||||||
text: '2' |
|
||||||
on_release: amount_label.value += self.text |
|
||||||
KButton: |
|
||||||
text: '3' |
|
||||||
on_release: amount_label.value += self.text |
|
||||||
KButton: |
|
||||||
text: '4' |
|
||||||
on_release: amount_label.value += self.text |
|
||||||
KButton: |
|
||||||
text: '5' |
|
||||||
on_release: amount_label.value += self.text |
|
||||||
KButton: |
|
||||||
text: '6' |
|
||||||
on_release: amount_label.value += self.text |
|
||||||
KButton: |
|
||||||
text: '7' |
|
||||||
on_release: amount_label.value += self.text |
|
||||||
KButton: |
|
||||||
text: '8' |
|
||||||
on_release: amount_label.value += self.text |
|
||||||
KButton: |
|
||||||
text: '9' |
|
||||||
on_release: amount_label.value += self.text |
|
||||||
KButton: |
|
||||||
text: '.' |
|
||||||
on_release: amount_label.value += self.text |
|
||||||
KButton: |
|
||||||
text: '0' |
|
||||||
on_release: amount_label.value += self.text |
|
||||||
KButton: |
|
||||||
text: '<' |
|
||||||
on_release: amount_label.value = amount_label.value[:-1] |
|
||||||
|
|
||||||
BoxLayout: |
|
||||||
size_hint: 0.5, None |
|
||||||
Button: |
|
||||||
size_hint: 0.5, None |
|
||||||
height: '48dp' |
height: '48dp' |
||||||
text: _('Max') |
id: 'spendable' |
||||||
on_release: popup.dismiss() |
Label: |
||||||
Button: |
text: _('Spendable:') |
||||||
size_hint: 0.5, None |
size_hint_x: 1 |
||||||
|
Button: |
||||||
|
size_hint_x: 1 |
||||||
|
height: '48dp' |
||||||
|
text: '' |
||||||
|
on_release: a.value = "max" |
||||||
|
|
||||||
|
BoxLayout: |
||||||
|
size_hint: 1, None |
||||||
height: '48dp' |
height: '48dp' |
||||||
text: _('OK') |
Label: |
||||||
on_release: popup.dismiss() |
id: a |
||||||
|
amount: '' |
||||||
|
text: self.amount + ' ' + app.base_unit if self.amount else '' |
||||||
|
Widget: |
||||||
|
size_hint_x: 1 |
||||||
|
|
||||||
|
Widget: |
||||||
|
size_hint: 1, 1 |
||||||
|
|
||||||
Widget: |
GridLayout: |
||||||
size_hint: 1, None |
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 |
||||||
|
|
||||||
|
BoxLayout: |
||||||
|
size_hint: 1, None |
||||||
|
height: '48dp' |
||||||
|
Widget: |
||||||
|
size_hint: 0.7, None |
||||||
|
height: '48dp' |
||||||
|
Button: |
||||||
|
size_hint: 0.3, None |
||||||
|
height: '48dp' |
||||||
|
text: _('OK') |
||||||
|
on_release: popup.dismiss() |
||||||
|
|
||||||
|
|||||||
Loading…
Reference in new issue