LBRY-Vault/electrum/gui/kivy/uix/ui_screens/send.kv
ThomasV a50f935aec Restructure invoices and requests (WIP)
- Terminology: use 'invoices' for outgoing payments, 'requests' for incoming payments
 - At the GUI level, try to handle invoices in a generic way.
 - Display ongoing payments in send tab.
2019-09-02 15:35:44 +02:00

178 lines
6.6 KiB
Text

#:import _ electrum.gui.kivy.i18n._
#:import Factory kivy.factory.Factory
#:import PR_TYPE_ADDRESS electrum.util.PR_TYPE_ADDRESS
#:import PR_TYPE_LN electrum.util.PR_TYPE_LN
#:import PR_TYPE_BIP70 electrum.util.PR_TYPE_BIP70
#:import Decimal decimal.Decimal
#:set btc_symbol chr(171)
#:set mbtc_symbol chr(187)
#:set font_light 'electrum/gui/kivy/data/fonts/Roboto-Condensed.ttf'
<PaymentLabel@Label>
#color: .305, .309, .309, 1
text_size: self.width, None
halign: 'left'
valign: 'top'
<PaymentItem@CardItem>
key: ''
memo: ''
amount: ''
status: ''
date: ''
BoxLayout:
spacing: '8dp'
height: '32dp'
orientation: 'vertical'
Widget
PaymentLabel:
text: root.memo
shorten: True
shorten_from: 'right'
Widget
PaymentLabel:
text: root.key
color: .699, .699, .699, 1
font_size: '13sp'
shorten: True
Widget
BoxLayout:
spacing: '8dp'
height: '32dp'
orientation: 'vertical'
Widget
PaymentLabel:
text: root.amount
halign: 'right'
font_size: '15sp'
Widget
PaymentLabel:
text: root.status
halign: 'right'
font_size: '13sp'
color: .699, .699, .699, 1
Widget
<PaymentRecycleView>:
viewclass: 'PaymentItem'
RecycleBoxLayout:
default_size: None, dp(56)
default_size_hint: 1, None
size_hint: 1, None
height: self.minimum_height
orientation: 'vertical'
SendScreen:
id: s
name: 'send'
address: ''
amount: ''
message: ''
destinationtype: PR_TYPE_ADDRESS
BoxLayout
padding: '12dp', '12dp', '12dp', '12dp'
spacing: '12dp'
orientation: 'vertical'
SendReceiveBlueBottom:
id: blue_bottom
size_hint: 1, None
height: self.minimum_height
BoxLayout:
size_hint: 1, None
height: blue_bottom.item_height
spacing: '5dp'
Image:
source: 'atlas://electrum/gui/kivy/theming/light/globe' if root.destinationtype != PR_TYPE_LN else 'atlas://electrum/gui/kivy/theming/light/lightning'
size_hint: None, None
size: '22dp', '22dp'
pos_hint: {'center_y': .5}
BlueButton:
id: payto_e
text: s.address if s.address else _('Recipient')
shorten: True
on_release: Clock.schedule_once(lambda dt: app.show_info(_('Copy and paste the recipient address using the Paste button, or use the camera to scan a QR code.')))
#on_release: Clock.schedule_once(lambda dt: app.popup_dialog('contacts'))
CardSeparator:
opacity: int(root.destinationtype == PR_TYPE_ADDRESS)
color: blue_bottom.foreground_color
BoxLayout:
size_hint: 1, None
height: blue_bottom.item_height
spacing: '5dp'
Image:
source: 'atlas://electrum/gui/kivy/theming/light/calculator'
opacity: 0.7
size_hint: None, None
size: '22dp', '22dp'
pos_hint: {'center_y': .5}
BlueButton:
id: amount_e
default_text: _('Amount')
text: s.amount if s.amount else _('Amount')
disabled: root.destinationtype == PR_TYPE_BIP70 or root.destinationtype == PR_TYPE_LN and not s.amount
on_release: Clock.schedule_once(lambda dt: app.amount_dialog(s, True))
CardSeparator:
opacity: int(root.destinationtype == PR_TYPE_ADDRESS)
color: blue_bottom.foreground_color
BoxLayout:
id: message_selection
size_hint: 1, None
height: blue_bottom.item_height
spacing: '5dp'
Image:
source: 'atlas://electrum/gui/kivy/theming/light/pen'
size_hint: None, None
size: '22dp', '22dp'
pos_hint: {'center_y': .5}
BlueButton:
id: description
text: s.message if s.message else ({PR_TYPE_LN: _('No description'), PR_TYPE_ADDRESS: _('Description'), PR_TYPE_BIP70: _('No Description')}[root.destinationtype])
disabled: root.destinationtype != PR_TYPE_ADDRESS
on_release: Clock.schedule_once(lambda dt: app.description_dialog(s))
CardSeparator:
opacity: int(root.destinationtype == PR_TYPE_ADDRESS)
color: blue_bottom.foreground_color
BoxLayout:
size_hint: 1, None
height: blue_bottom.item_height
spacing: '5dp'
Image:
source: 'atlas://electrum/gui/kivy/theming/light/star_big_inactive'
size_hint: None, None
size: '22dp', '22dp'
pos_hint: {'center_y': .5}
BlueButton:
id: fee_e
default_text: _('Fee')
text: app.fee_status if root.destinationtype != PR_TYPE_LN else ''
on_release: Clock.schedule_once(lambda dt: app.fee_dialog(s, True)) if root.destinationtype != PR_TYPE_LN else None
BoxLayout:
size_hint: 1, None
height: '48dp'
IconButton:
size_hint: 0.5, 1
on_release: s.parent.do_save()
icon: 'atlas://electrum/gui/kivy/theming/light/save'
IconButton:
size_hint: 0.5, 1
icon: 'atlas://electrum/gui/kivy/theming/light/copy'
on_release: s.parent.do_paste()
IconButton:
id: qr
size_hint: 1, 1
on_release: Clock.schedule_once(lambda dt: app.scan_qr(on_complete=app.on_qr))
icon: 'atlas://electrum/gui/kivy/theming/light/camera'
Button:
text: _('Clear')
size_hint: 1, 1
on_release: s.parent.do_clear()
Button:
text: _('Pay')
size_hint: 1, 1
on_release: s.parent.do_pay()
Widget:
size_hint: 1, 0.1
PaymentRecycleView:
id: payments_container
scroll_type: ['bars', 'content']
bar_width: '25dp'