1
0

kivy: base_unit setting

This commit is contained in:
ThomasV
2015-10-15 11:18:10 +02:00
parent d70948f74f
commit 069a6455c7
4 changed files with 24 additions and 71 deletions

View File

@@ -113,13 +113,6 @@ class HistoryScreen(CScreen):
else:
icon = "atlas://gui/kivy/theming/light/confirmed"
if value is not None:
v_str = self.app.format_amount(value, True).replace(',','.')
else:
v_str = '--'
balance_str = self.app.format_amount(balance).replace(',','.')
if tx_hash:
label, is_default_label = self.app.wallet.get_label(tx_hash)
else:
@@ -130,7 +123,7 @@ class HistoryScreen(CScreen):
rate = self.get_history_rate(value, timestamp)
quote_text = "..." if rate is None else "{0:.3} {1}".format(rate, quote_currency)
yield (conf, icon, time_str, label, v_str, balance_str, tx_hash, quote_text)
yield (conf, icon, time_str, label, value, tx_hash, quote_text)
def update(self, see_all=False):
if self.app.wallet is None:
@@ -148,14 +141,13 @@ class HistoryScreen(CScreen):
count = 0
for item in history:
count += 1
conf, icon, date_time, address, amount, balance, tx, quote_text = item
conf, icon, date_time, address, value, tx, quote_text = item
ri = RecentActivityItem()
ri.icon = icon
ri.date = date_time
ri.address = address
ri.amount = amount
ri.value = value
ri.quote_text = quote_text
ri.balance = balance
ri.confirmations = conf
ri.tx_hash = tx
history_add(ri)

View File

@@ -54,9 +54,9 @@
<RecentActivityItem@CardItem>
icon: 'atlas://gui/kivy/theming/light/important'
address:'no address set'
amount: '+0.00'
balance: 'xyz'# balance_after
amount_color: '#DB3627' if float(self.amount) < 0 else '#2EA442'
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'
confirmations: 0
date: '0/0/0'
quote_text: '.'
@@ -91,15 +91,15 @@
halign: 'right'
font_size: '13sp'
size_hint: None, 1
width: '90sp'
width: '110sp'
markup: True
font_name: font_light
text:
u'[color={amount_color}]{sign}{symbol}{amount}[/color]\n'\
u'[color={amount_color}]{sign}{amount} {unit}[/color]\n'\
u'[color=#B2B3B3][size=12sp]{qt}[/size]'\
u'[/color]'.format(amount_color=root.amount_color,\
amount=root.amount[1:], qt=root.quote_text, sign=root.amount[0],\
symbol=btc_symbol if app.base_unit == 'BTC' else mbtc_symbol)
unit=app.base_unit)
CardSeparator
<CardRecentActivity@Card>

View File

@@ -14,10 +14,11 @@ Popup:
height: '48dp'
size_hint: 1, None
Spinner:
text: 'BTC'
text: app.base_unit
values: ('BTC', 'mBTC')
size_hint: 1, None
height: '48dp'
on_text: app.base_unit = self.text
Label:
size_hint: 1, None