mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-30 08:51:32 +00:00
kivy: improve open_channel dialog
This commit is contained in:
parent
cb14bde422
commit
eadd5d58e8
1 changed files with 19 additions and 15 deletions
|
@ -42,19 +42,6 @@ Builder.load_string('''
|
|||
BlueButton:
|
||||
text: s.pubkey if s.pubkey else _('Node ID')
|
||||
shorten: True
|
||||
#CardSeparator:
|
||||
# color: blue_bottom.foreground_color
|
||||
#BoxLayout:
|
||||
# size_hint: 1, None
|
||||
# height: blue_bottom.item_height
|
||||
# Image:
|
||||
# source: 'atlas://electrum/gui/kivy/theming/light/network'
|
||||
# size_hint: None, None
|
||||
# size: '22dp', '22dp'
|
||||
# pos_hint: {'center_y': .5}
|
||||
# BlueButton:
|
||||
# text: s.ipport if s.ipport else _('host:port')
|
||||
# on_release: s.ipport_dialog()
|
||||
CardSeparator:
|
||||
color: blue_bottom.foreground_color
|
||||
BoxLayout:
|
||||
|
@ -68,8 +55,11 @@ Builder.load_string('''
|
|||
BlueButton:
|
||||
text: s.amount if s.amount else _('Amount')
|
||||
on_release: app.amount_dialog(s, True)
|
||||
TopLabel:
|
||||
text: _('Paste or scan a node ID, a connection string or a lightning invoice.')
|
||||
BoxLayout:
|
||||
size_hint: 1, None
|
||||
height: '48dp'
|
||||
IconButton:
|
||||
icon: 'atlas://electrum/gui/kivy/theming/light/copy'
|
||||
size_hint: 0.5, None
|
||||
|
@ -85,13 +75,23 @@ Builder.load_string('''
|
|||
size_hint: 1, None
|
||||
height: '48dp'
|
||||
on_release: s.choose_node()
|
||||
Button:
|
||||
text: _('Clear')
|
||||
size_hint: 1, None
|
||||
height: '48dp'
|
||||
on_release: s.do_clear()
|
||||
Widget:
|
||||
size_hint: 1, 1
|
||||
BoxLayout:
|
||||
size_hint: 1, None
|
||||
Widget:
|
||||
size_hint: 2, None
|
||||
Button:
|
||||
text: _('Open')
|
||||
size_hint: 1, None
|
||||
height: '48dp'
|
||||
on_release: s.open_channel()
|
||||
Widget:
|
||||
size_hint: 1, 1
|
||||
disabled: not root.pubkey or not root.amount
|
||||
''')
|
||||
|
||||
class LightningOpenChannelDialog(Factory.Popup):
|
||||
|
@ -123,6 +123,10 @@ class LightningOpenChannelDialog(Factory.Popup):
|
|||
if self.msg:
|
||||
self.app.show_info(self.msg)
|
||||
|
||||
def do_clear(self):
|
||||
self.pubkey = ''
|
||||
self.amount = ''
|
||||
|
||||
def do_paste(self):
|
||||
contents = self.app._clipboard.paste()
|
||||
if not contents:
|
||||
|
|
Loading…
Add table
Reference in a new issue