From 3f473e6915744b1dc60ef20f436138aad22b28d5 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 14 Oct 2015 15:13:47 +0200 Subject: [PATCH] kivy: improve send tab --- gui/kivy/main.kv | 2 -- gui/kivy/main_window.py | 6 ++++-- gui/kivy/uix/screens.py | 3 ++- gui/kivy/uix/ui_screens/amount.kv | 15 +++++++++++---- gui/kivy/uix/ui_screens/send.kv | 31 ++++++++++++------------------- 5 files changed, 29 insertions(+), 28 deletions(-) diff --git a/gui/kivy/main.kv b/gui/kivy/main.kv index 412ae898a..0cd0d561c 100644 --- a/gui/kivy/main.kv +++ b/gui/kivy/main.kv @@ -183,8 +183,6 @@ source: 'atlas://gui/kivy/theming/light/card_bottom' size: self.size pos: self.pos - Color: - rgba: 1, 1, 1, 1 item_height: dp(42) foreground_color: .843, .914, .972, 1 diff --git a/gui/kivy/main_window.py b/gui/kivy/main_window.py index 083d0723c..184bc8355 100644 --- a/gui/kivy/main_window.py +++ b/gui/kivy/main_window.py @@ -792,9 +792,11 @@ class ElectrumWindow(App): def amount_dialog(self, label, callback): popup = Builder.load_file('gui/kivy/uix/ui_screens/amount.kv') - popup.ids.amount_label.text = label.text + if label.text != 'Amount': + popup.ids.amount_label.text = label.text def cb(): - label.text = popup.ids.amount_label.text + o = popup.ids.amount_label.text + label.text = o if o else 'Amount' if callback: callback() popup.on_dismiss = cb diff --git a/gui/kivy/uix/screens.py b/gui/kivy/uix/screens.py index 80189f968..256fa44e2 100644 --- a/gui/kivy/uix/screens.py +++ b/gui/kivy/uix/screens.py @@ -205,7 +205,8 @@ class SendScreen(CScreen): def do_clear(self): cts = self.ids - cts.payto_e.text = cts.message_e.text = cts.amount_e.text = '' + cts.payto_e.text = cts.message_e.text = '' + cts.amount_e.text = 'Amount' #self.set_frozen(content, False) #self.update_status() diff --git a/gui/kivy/uix/ui_screens/amount.kv b/gui/kivy/uix/ui_screens/amount.kv index 8033e438d..925ea7e26 100644 --- a/gui/kivy/uix/ui_screens/amount.kv +++ b/gui/kivy/uix/ui_screens/amount.kv @@ -56,11 +56,18 @@ Popup: text: '<' on_release: amount_label.text = amount_label.text[:-1] - Button: + BoxLayout: size_hint: 0.5, None - height: '48dp' - text: _('OK') - on_release: popup.dismiss() + Button: + size_hint: 0.5, None + height: '48dp' + text: _('Max') + on_release: popup.dismiss() + Button: + size_hint: 0.5, None + height: '48dp' + text: _('OK') + on_release: popup.dismiss() Widget: size_hint: 1, None diff --git a/gui/kivy/uix/ui_screens/send.kv b/gui/kivy/uix/ui_screens/send.kv index 4579ce099..807bfc425 100644 --- a/gui/kivy/uix/ui_screens/send.kv +++ b/gui/kivy/uix/ui_screens/send.kv @@ -71,7 +71,7 @@ SendScreen: SendReceiveToggle: SendToggle: id: qr - text: 'Scan QR Code' + text: 'QR Code' group: 'send_type' source: 'atlas://gui/kivy/theming/light/qrcode' on_release: @@ -98,17 +98,19 @@ SendScreen: BoxLayout size_hint: 1, None height: blue_bottom.item_height - Label: - id: lbl_symbl - text: 'Amount' - size_hint: 0.5, None - height: '38dp' + Image: + source: 'atlas://gui/kivy/theming/light/bit_logo' + size_hint: None, None + size: '22dp', '22dp' + pos_hint: {'center_y': .5} Button: id: amount_e - text: '' + text: 'Amount' size_hint: 0.5, None height: '38dp' on_release: app.amount_dialog(amount_e, None) + background_color: .238, .585, .878, 0 + CardSeparator opacity: message_selection.opacity color: blue_bottom.foreground_color @@ -129,15 +131,6 @@ SendScreen: height=blue_bottom.item_height)\ .start(message_selection) message_e.focus = True - Widget: - size_hint: None, None - width: dp(2) - height: qr.height - pos_hint: {'center_y':.5} - canvas.after: - Rectangle: - size: self.size - pos: self.pos CardSeparator opacity: message_selection.opacity color: blue_bottom.foreground_color @@ -155,9 +148,9 @@ SendScreen: TextInputSendBlue: id: message_e hint_text: 'Enter description here' - on_text_validate: - anim = Factory.Animation(opacity=1, height=blue_bottom.item_height) - anim.start(wallet_selection) + #on_text_validate: + # anim = Factory.Animation(opacity=1, height=blue_bottom.item_height) + # anim.start(wallet_selection) BoxLayout: Button: