1
0

kivy: add status icons, improve requests layout

This commit is contained in:
ThomasV
2015-12-13 10:42:48 +01:00
parent b1704ce911
commit 9caf174d7f
5 changed files with 94 additions and 63 deletions

View File

@@ -5,23 +5,9 @@
#:set mbtc_symbol unichr(187)
<Card@GridLayout>
cols: 1
padding: '12dp' , '22dp', '12dp' , '12dp'
spacing: '12dp'
size_hint: 1, None
height: max(100, self.minimum_height)
canvas.before:
Color:
rgba: 1, 1, 1, 1
BorderImage:
border: 18, 18, 18, 18
source: 'atlas://gui/kivy/theming/light/card'
size: self.size
pos: self.pos
<CardLabel@Label>
color: 0.45, 0.45, 0.45, 1
color: 0.95, 0.95, 0.95, 1
size_hint: 1, None
text: ''
text_size: self.width, None
@@ -29,21 +15,13 @@
halign: 'left'
valign: 'top'
<CardButton@Button>
background_normal: 'atlas://gui/kivy/theming/light/card_btn'
bold: True
font_size: '10sp'
color: 0.699, 0.699, 0.699, 1
size_hint: None, None
size: self.texture_size[0] + dp(32), self.texture_size[1] + dp(7)
<RecentActivityItem@CardItem>
<HistoryItem@CardItem>
icon: 'atlas://gui/kivy/theming/light/important'
address: 'no address set'
message: ''
value: 0
amount: app.format_amount(self.value, True) if self.value is not None else '--'
amount_color: '#DB3627' if self.value < 0 else '#2EA442'
amount_color: '#FF6657' if self.value < 0 else '#2EA442'
confirmations: 0
date: '0/0/0'
quote_text: '.'
@@ -62,26 +40,26 @@
BoxLayout:
orientation: 'vertical'
Widget
CardLabel:
shorten: True
text: root.address
markup: False
text_size: self.size
CardLabel:
color: .699, .699, .699, 1
text: root.date
font_size: '12sp'
font_size: '14sp'
CardLabel:
shorten: True
text: root.message
markup: False
text_size: self.size
Widget
CardLabel:
halign: 'right'
font_size: '13sp'
font_size: '15sp'
size_hint: None, 1
width: '110sp'
markup: True
font_name: font_light
text:
u'[color={amount_color}]{sign}{amount} {unit}[/color]\n'\
u'[color=#B2B3B3][size=12sp]{qt}[/size]'\
u'[color=#B2B3B3][size=13sp]{qt}[/size]'\
u'[/color]'.format(amount_color=root.amount_color,\
amount=root.amount[1:], qt=root.quote_text, sign=root.amount[0],\
unit=app.base_unit)

View File

@@ -1,8 +1,8 @@
<InvoicesLabel@Label>
#color: .305, .309, .309, 1
text_size: self.size
text_size: self.width, None
halign: 'left'
valign: 'middle'
valign: 'top'
<InvoiceItem@CardItem>
requestor: ''
@@ -10,11 +10,32 @@
amount: ''
status: ''
date: ''
icon: 'atlas://gui/kivy/theming/light/important'
Image:
id: icon
source: root.icon
size_hint: None, 1
width: self.height *.54
mipmap: True
BoxLayout:
spacing: '8dp'
height: '32dp'
orientation: 'vertical'
Widget
InvoicesLabel:
text: root.requestor
shorten: True
InvoicesLabel:
text: root.memo
color: .699, .699, .699, 1
font_size: '13sp'
shorten: True
Widget
InvoicesLabel:
text: root.requestor
InvoicesLabel:
text: root.memo
InvoicesLabel:
halign: 'right'
font_size: '15sp'
size_hint: None, 1
width: '80sp'
text: root.amount
InvoicesScreen:

View File

@@ -1,8 +1,8 @@
<RequestLabel@Label>
#color: .305, .309, .309, 1
text_size: self.size
text_size: self.width, None
halign: 'left'
valign: 'middle'
valign: 'top'
<RequestItem@CardItem>
address: ''
@@ -10,15 +10,33 @@
amount: ''
status: ''
date: ''
icon: 'atlas://gui/kivy/theming/light/important'
Image:
id: icon
source: root.icon
size_hint: None, 1
width: self.height *.54
mipmap: True
BoxLayout:
spacing: '8dp'
height: '32dp'
orientation: 'vertical'
Widget
RequestLabel:
text: root.address
shorten: True
RequestLabel:
text: root.memo
color: .699, .699, .699, 1
font_size: '13sp'
shorten: True
Widget
RequestLabel:
text: root.address
font_size: '13dp'
RequestLabel:
text: root.memo
RequestLabel:
halign: 'right'
font_size: '15sp'
size_hint: None, 1
width: '80sp'
text: root.amount
#InvoicesLabel:
# text: root.status
RequestsScreen: