electrum

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

commit d25ee6d57645aadb82e646a6ad38429e39405e86
parent 0024980e2f926aec5554dfbd1344ae5d22d937fd
Author: ThomasV <thomasv@electrum.org>
Date:   Wed, 14 Oct 2015 18:03:02 +0200

kivy: gui fixes

Diffstat:
Mgui/kivy/main.kv | 12++++++++++++
Mgui/kivy/uix/screens.py | 13++++++++-----
Mgui/kivy/uix/ui_screens/receive.kv | 8+++++---
Mgui/kivy/uix/ui_screens/send.kv | 32+++++++++++---------------------
4 files changed, 36 insertions(+), 29 deletions(-)

diff --git a/gui/kivy/main.kv b/gui/kivy/main.kv @@ -208,6 +208,18 @@ values: [] #app.wallet.addresses() if app.wallet else [] text: _("Select Your address") +<TextInputBlue@TextInput> + padding: '5dp' + size_hint: 1, None + height: '27dp' + pos_hint: {'center_y':.5} + multiline: False + hint_text_color: self.foreground_color + foreground_color: .843, .914, .972, 1 + background_color: 1, 1, 1, 1 + background_normal: 'atlas://gui/kivy/theming/light/tab_btn' + background_active: 'atlas://gui/kivy/theming/light/textinput_active' + #<ElectrumScreen> # ScrollView: diff --git a/gui/kivy/uix/screens.py b/gui/kivy/uix/screens.py @@ -272,12 +272,15 @@ class ReceiveScreen(CScreen): raise def update_qr(self): - address_label = self.screen.ids.get('address') - address = address_label.text - amount_label = self.screen.ids.get('amount') - amount = amount_label.text + from electrum.util import create_URI + address = self.screen.ids.get('address').text + amount = self.screen.ids.get('amount').text + default_text = self.screen.ids.get('amount').default_text + amount = None if amount == default_text else 100000000 * Decimal(amount) + msg = self.screen.ids.get('message').text + uri = create_URI(address, amount, msg) + print "z", msg qr = self.screen.ids.get('qr') - uri = 'bitcoin:'+ address + '?amount='+amount if address and amount else address qr.set_data(uri) diff --git a/gui/kivy/uix/ui_screens/receive.kv b/gui/kivy/uix/ui_screens/receive.kv @@ -71,7 +71,9 @@ ReceiveScreen: size_hint: None, None size: '22dp', '22dp' pos_hint: {'center_y': .5} - TextInputSendBlue: - id: message_e + TextInputBlue: + id: message hint_text: 'Description (optional)' - + on_text_validate: receive_screen.parent.update_qr + Widget: + size_hint: 1, 0.5 diff --git a/gui/kivy/uix/ui_screens/send.kv b/gui/kivy/uix/ui_screens/send.kv @@ -6,17 +6,6 @@ #:set mbtc_symbol unichr(187) #:set font_light 'data/fonts/Roboto-Condensed.ttf' -<TextInputSendBlue@TextInput> - padding: '5dp' - size_hint: 1, None - height: '27dp' - pos_hint: {'center_y':.5} - multiline: False - hint_text_color: self.foreground_color - foreground_color: .843, .914, .972, 1 - background_color: 1, 1, 1, 1 - background_normal: 'atlas://gui/kivy/theming/light/tab_btn' - background_active: 'atlas://gui/kivy/theming/light/textinput_active' <SendToggle@ToggleButton> source: '' @@ -56,7 +45,6 @@ SendScreen: id: send_screen - mode: 'address' name: 'send' #action_view: Factory.SendActionView() #on_deactivate: @@ -67,8 +55,8 @@ SendScreen: padding: '12dp', '12dp', '12dp', '12dp' spacing: '12dp' orientation: 'vertical' - mode: 'address' SendReceiveToggle: + size_hint: 1, None SendToggle: id: qr text: 'QR Code' @@ -99,7 +87,7 @@ SendScreen: size_hint: None, None size: '22dp', '22dp' pos_hint: {'center_y': .5} - TextInputSendBlue: + TextInputBlue: id: payto_e hint_text: "Recipient" CardSeparator: @@ -115,12 +103,13 @@ SendScreen: pos_hint: {'center_y': .5} Button: id: amount_e - text: 'Amount' - text_size: (amount_e.width-15, None) + default_text: 'Amount' + text: self.default_text + text_size: (self.width-15, None) halign: 'left' size_hint: 0.5, None height: '38dp' - on_release: app.amount_dialog(amount_e, None) + on_release: app.amount_dialog(self, None) background_color: .238, .585, .878, 0 CardSeparator: opacity: message_selection.opacity @@ -136,22 +125,23 @@ SendScreen: size_hint: None, None size: '22dp', '22dp' pos_hint: {'center_y': .5} - TextInputSendBlue: + TextInputBlue: id: message_e hint_text: 'Optional description' BoxLayout: size_hint: 1, None + height: '38dp' Button: text: _('Clear') - size_hint_y: None + size_hint: 1, None height: '38dp' on_release: send_screen.do_clear() Button: text: _('Send') - size_hint_y: None + size_hint: 1, None height: '38dp' on_release: send_screen.do_send() Widget: - size_hint: 1, None + size_hint: 1, 1