1
0

kivy: replace requests tab by address tab

This commit is contained in:
Antoine Riard
2017-11-03 11:50:30 -04:00
parent 358068a0c1
commit 70bfcaaf59
5 changed files with 407 additions and 49 deletions

View File

@@ -0,0 +1,129 @@
#:import _ electrum_gui.kivy.i18n._
#:import Decimal decimal.Decimal
#:set btc_symbol chr(171)
#:set mbtc_symbol chr(187)
#:set font_light 'gui/kivy/data/fonts/Roboto-Condensed.ttf'
<RequestLabel@Label>
text_size: self.width, None
halign: 'left'
valign: 'top'
<RequestItem@CardItem>
address: ''
memo: ''
amount: ''
status: ''
date: ''
icon: ''
color: .699, .699, .699, 1
Image:
id: icon
source: root.icon
size_hint: None, 1
width: self.height *.54 if root.icon else 0
mipmap: True
BoxLayout:
spacing: '8dp'
height: '32dp'
orientation: 'vertical'
Widget
RequestLabel:
text: root.address
shorten: True
Widget
RequestLabel:
text: root.date + " " + root.memo
color: .699, .699, .699, 1
font_size: '13sp'
shorten: True
Widget
BoxLayout:
spacing: '8dp'
height: '32dp'
orientation: 'vertical'
Widget
RequestLabel:
text: root.amount
halign: 'right'
font_size: '15sp'
Widget
RequestLabel:
text: root.status
halign: 'right'
font_size: '13sp'
color: .699, .699, .699, 1
AddressScreen:
id: addr_screen
name: 'address'
message: ''
addr_type: 'Receiving'
addr_status: 'New'
pr_status: 'Pending'
on_message:
self.parent.generic_search()
BoxLayout
padding: '12dp', '70dp', '12dp', '12dp'
spacing: '12dp'
orientation: 'vertical'
size_hint: 1, 1.1
BoxLayout:
spacing: '6dp'
size_hint: 1, None
orientation: 'horizontal'
AddressFilter:
id: blue_bottom
opacity: 1
size_hint: 1, None
height: self.minimum_height
spacing: '5dp'
AddressButton:
id: search
text: addr_screen.addr_type
on_release: Clock.schedule_once(lambda dt: app.address_screen.search(0))
AddressFilter:
id: blue_bottom
opacity: 1
size_hint: 1, None
height: self.minimum_height
spacing: '5dp'
AddressButton:
id: search
text: addr_screen.addr_status
on_release: Clock.schedule_once(lambda dt: app.address_screen.search(1))
AddressFilter:
id: blue_bottom
opacity: 1
size_hint: 1, None
height: self.minimum_height
spacing: '5dp'
AddressButton:
id: pending
text: addr_screen.pr_status
on_release: Clock.schedule_once(lambda dt: app.address_screen.search(2))
AddressFilter:
id: blue_bottom
opacity: 1
size_hint: 1, None
height: self.minimum_height
spacing: '5dp'
canvas.before:
Color:
rgba: 0.9, 0.9, 0.9, 1
AddressButton:
id: change
text: addr_screen.message if addr_screen.message else _('Search')
on_release: Clock.schedule_once(lambda dt: app.description_dialog(addr_screen))
ScrollView:
GridLayout:
cols: 1
id: search_container
size_hint_y: None
height: self.minimum_height
spacing: '2dp'

View File

@@ -11,6 +11,9 @@ Popup:
description: ''
status: ''
signature: ''
isaddr: ''
fund: 0
pk: ''
title: _('Invoice') if popup.is_invoice else _('Request')
tx_hash: ''
BoxLayout:
@@ -28,10 +31,10 @@ Popup:
height: self.minimum_height
spacing: '10dp'
BoxLabel:
text: (_('Status') if popup.amount or popup.is_invoice else _('Amount received')) if root.status else ''
text: (_('Status') if popup.amount or popup.is_invoice or popup.isaddr == 'y' else _('Amount received')) if root.status else ''
value: root.status
BoxLabel:
text: _('Amount') if root.amount else ''
text: _('Request amount') if root.amount else ''
value: app.format_amount_and_units(root.amount) if root.amount else ''
BoxLabel:
text: _('Requestor') if popup.is_invoice else _('Address')
@@ -45,6 +48,15 @@ Popup:
BoxLabel:
text: _('Description') if root.description else ''
value: root.description
BoxLabel:
text: _('Balance') if popup.fund else ''
value: app.format_amount_and_units(root.fund) if root.fund else ''
TopLabel:
text: _('Private Key')
RefLabel:
id: pk_label
touched: True if not self.touched else True
data: root.pk
TopLabel:
text: _('Outputs') if popup.is_invoice else ''
@@ -65,7 +77,13 @@ Popup:
size_hint: 0.5, None
height: '48dp'
Button:
size_hint: 0.5, None
size_hint: 2, None
height: '48dp'
text: _('Close')
on_release: popup.dismiss()
Button:
size_hint: 2, None
height: '48dp'
text: _('Hide private key') if pk_label.data else _('Export private key')
on_release:
setattr(pk_label, 'data', '') if pk_label.data else popup.export(pk_label, popup.requestor)