Browse Source

kivy: improve send tab

283
ThomasV 9 years ago
parent
commit
3f473e6915
  1. 2
      gui/kivy/main.kv
  2. 4
      gui/kivy/main_window.py
  3. 3
      gui/kivy/uix/screens.py
  4. 7
      gui/kivy/uix/ui_screens/amount.kv
  5. 31
      gui/kivy/uix/ui_screens/send.kv

2
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

4
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')
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

3
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()

7
gui/kivy/uix/ui_screens/amount.kv

@ -56,6 +56,13 @@ Popup:
text: '<'
on_release: amount_label.text = amount_label.text[:-1]
BoxLayout:
size_hint: 0.5, None
Button:
size_hint: 0.5, None
height: '48dp'
text: _('Max')
on_release: popup.dismiss()
Button:
size_hint: 0.5, None
height: '48dp'

31
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:

Loading…
Cancel
Save