electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit d5effe48d07b667313deede1dede3d6ef6bebf5f
parent 4b7cf297f5cf9513b32fcce2c5773af2ab1c7492
Author: ThomasV <thomasv@electrum.org>
Date:   Fri,  2 Mar 2018 19:16:08 +0100

kivy: do not show balance in every tab. fixes #3350

Diffstat:
Mgui/kivy/main.kv | 2+-
Mgui/kivy/main_window.py | 15++++++++-------
Mgui/kivy/uix/screens.py | 5-----
Mgui/kivy/uix/ui_screens/history.kv | 30++++++++++++++++++++----------
4 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/gui/kivy/main.kv b/gui/kivy/main.kv @@ -397,7 +397,7 @@ slide: 1 CleanHeader: id: history_tab - text: _('History') + text: _('Balance') slide: 2 CleanHeader: id: receive_tab diff --git a/gui/kivy/main_window.py b/gui/kivy/main_window.py @@ -83,6 +83,7 @@ class ElectrumWindow(App): num_chains = NumericProperty(0) blockchain_name = StringProperty('') fee_status = StringProperty('Fee') + balance = StringProperty('') blockchain_checkpoint = NumericProperty(0) auto_connect = BooleanProperty(False) @@ -634,16 +635,16 @@ class ElectrumWindow(App): if not self.wallet.up_to_date or server_height == 0: status = _("Synchronizing...") elif server_lag > 1: - status = _("Server lagging ({} blocks)").format(server_lag) + status = _("Server lagging") else: - c, u, x = self.wallet.get_balance() - text = self.format_amount(c+x+u) - status = str(text.strip() + ' ' + self.base_unit) + status = '' else: status = _("Disconnected") - - n = self.wallet.basename() - self.status = '[size=15dp]%s[/size]\n%s' %(n, status) + self.status = self.wallet.basename() + (' [size=15dp](%s)[/size]'%status if status else '') + # balance + c, u, x = self.wallet.get_balance() + text = self.format_amount(c+x+u) + self.balance = str(text.strip() + ' ' + self.base_unit) #fiat_balance = self.fx.format_amount_and_units(c+u+x) or '' def get_max_amount(self): diff --git a/gui/kivy/uix/screens.py b/gui/kivy/uix/screens.py @@ -162,13 +162,8 @@ class HistoryScreen(CScreen): count = 0 for item in history: ri = self.get_card(*item) - count += 1 history_card.add_widget(ri) - if count == 0: - msg = _('This screen shows your list of transactions. It is currently empty.') - history_card.add_widget(EmptyLabel(text=msg)) - class SendScreen(CScreen): diff --git a/gui/kivy/uix/ui_screens/history.kv b/gui/kivy/uix/ui_screens/history.kv @@ -62,13 +62,23 @@ HistoryScreen: name: 'history' content: content - ScrollView: - id: content - do_scroll_x: False - GridLayout - id: history_container - cols: 1 - size_hint: 1, None - height: self.minimum_height - padding: '12dp' - spacing: '2dp' + BoxLayout: + orientation: 'vertical' + Label: + text: app.balance + color: .699, .699, .699, 1 + font_size: '22dp' + bold: True + size_hint: 1, 0.25 + ScrollView: + id: content + do_scroll_x: False + size_hint: 1, 0.75 + #height: self.minimum_height + GridLayout + id: history_container + cols: 1 + size_hint: 1, None + height: self.minimum_height + padding: '12dp' + spacing: '2dp'