electrum

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

commit 54897c84f8a17b9cf53f6d4fcbbd46ea514be2ab
parent 74c9a05757d1f98263480d6b0ceb2f1c7ddfdbb6
Author: ThomasV <thomasv@electrum.org>
Date:   Wed, 17 Feb 2016 15:19:09 +0100

kivy fixes

Diffstat:
Mgui/kivy/main.kv | 3+--
Mgui/kivy/main_window.py | 1+
Mgui/kivy/uix/dialogs/__init__.py | 5+++++
Mgui/kivy/uix/dialogs/tx_dialog.py | 23+++++++++++++----------
Mgui/kivy/uix/ui_screens/invoice.kv | 3+++
5 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/gui/kivy/main.kv b/gui/kivy/main.kv @@ -44,7 +44,6 @@ # Custom Global Widgets <TopLabel@Label> - valign: 'top' size_hint_y: None text_size: self.width, None height: self.texture_size[1] @@ -80,8 +79,8 @@ ######################### <OutputList> - size_hint: 1, None height: self.minimum_height + size_hint_y: None cols: 2 spacing: '10dp' padding: '10dp' diff --git a/gui/kivy/main_window.py b/gui/kivy/main_window.py @@ -297,6 +297,7 @@ class ElectrumWindow(App): if txid: popup.ids.txid_label.text = _("Transaction ID") + ':\n' + ' '.join(map(''.join, zip(*[iter(txid)]*4))) popup.open() + popup.ids.output_list.update(req.get('outputs', [])) def qr_dialog(self, title, data): from uix.dialogs.qr_dialog import QRDialog diff --git a/gui/kivy/uix/dialogs/__init__.py b/gui/kivy/uix/dialogs/__init__.py @@ -197,6 +197,11 @@ class OutputList(Factory.GridLayout): super(Factory.GridLayout, self).__init__(**kwargs) self.app = App.get_running_app() + def update(self, outputs): + self.clear_widgets() + for (type, address, amount) in outputs: + self.add_output(address, amount) + def add_output(self, address, amount): t = Factory.CardLabel(text = '[ref=%s]%s[/ref]'%(address,address), font_size = '6pt') t.shorten = True diff --git a/gui/kivy/uix/dialogs/tx_dialog.py b/gui/kivy/uix/dialogs/tx_dialog.py @@ -23,13 +23,15 @@ Builder.load_string(''' description: '' outputs_str: '' ScrollView: - BoxLayout: - orientation: 'vertical' + GridLayout: + height: self.minimum_height + size_hint_y: None + cols: 1 spacing: '10dp' padding: '10dp' GridLayout: - size_hint: 1, None height: self.minimum_height + size_hint_y: None cols: 2 spacing: '10dp' TopLabel: @@ -55,7 +57,9 @@ Builder.load_string(''' TopLabel: text: _('Outputs') + ':' OutputList: - id: outputs + height: self.minimum_height + size_hint: 1, None + id: output_list TopLabel: text: _('Transaction ID') + ':' if root.tx_hash else '' TopLabel: @@ -71,8 +75,8 @@ Builder.load_string(''' Rectangle: size: self.size pos: self.pos - Widget: - size_hint: 1, 0.2 + #Widget: + # size_hint: 1, 0.2 BoxLayout: size_hint: 1, None @@ -106,6 +110,8 @@ class TxDialog(Factory.Popup): self.app = app self.wallet = self.app.wallet self.tx = tx + + def on_open(self): self.update() def update(self): @@ -142,10 +148,7 @@ class TxDialog(Factory.Popup): self.amount_str = _("Transaction unrelated to your wallet") self.fee_str = '' self.can_sign = self.wallet.can_sign(self.tx) - - self.ids.outputs.clear_widgets() - for (type, address, amount) in self.tx.outputs(): - self.ids.outputs.add_output(address, amount) + self.ids.output_list.update(self.tx.outputs()) def do_sign(self): self.app.protected(_("Enter your PIN code in order to sign this transaction"), self._do_sign, ()) diff --git a/gui/kivy/uix/ui_screens/invoice.kv b/gui/kivy/uix/ui_screens/invoice.kv @@ -17,6 +17,7 @@ Popup: GridLayout: spacing: '10dp' padding: '10dp' + height: self.minimum_height cols: 2 TopLabel: text: _('Requestor') if popup.is_invoice else _('Address') @@ -43,6 +44,8 @@ Popup: TopLabel: text: root.status + OutputList: + id: output_list TopLabel: id: txid_label Widget: