mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
misc Qt fixes
- improve layout of send tab - use tabs to show receive widgets - add menu item to copy address from request - show copied content in copy dialog
This commit is contained in:
parent
d35791ff65
commit
d1f4804962
2 changed files with 14 additions and 14 deletions
|
@ -1014,14 +1014,14 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
||||||
vbox_g.addLayout(grid)
|
vbox_g.addLayout(grid)
|
||||||
vbox_g.addStretch()
|
vbox_g.addStretch()
|
||||||
|
|
||||||
hbox_r = QHBoxLayout()
|
self.receive_widgets = QTabWidget()
|
||||||
hbox_r.addWidget(self.receive_qr)
|
self.receive_widgets.addTab(self.receive_qr, 'QR Code')
|
||||||
hbox_r.addWidget(self.receive_address_e)
|
self.receive_widgets.addTab(self.receive_address_e, 'Text')
|
||||||
|
|
||||||
hbox = QHBoxLayout()
|
hbox = QHBoxLayout()
|
||||||
hbox.addLayout(vbox_g)
|
hbox.addLayout(vbox_g)
|
||||||
hbox.addStretch()
|
hbox.addStretch()
|
||||||
hbox.addLayout(hbox_r)
|
hbox.addWidget(self.receive_widgets)
|
||||||
|
|
||||||
w = QWidget()
|
w = QWidget()
|
||||||
w.searchable_list = self.request_list
|
w.searchable_list = self.request_list
|
||||||
|
@ -1108,8 +1108,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
||||||
|
|
||||||
def do_copy(self, title, content):
|
def do_copy(self, title, content):
|
||||||
self.app.clipboard().setText(content)
|
self.app.clipboard().setText(content)
|
||||||
self.show_message(_("{} copied to clipboard").format(title))
|
self.show_message(_(f"{title} copied to clipboard:\n\n{content}"))
|
||||||
#QToolTip.showText(QCursor.pos(), _("{} copied to clipboard").format(title), self.parent)
|
|
||||||
|
|
||||||
def export_payment_request(self, addr):
|
def export_payment_request(self, addr):
|
||||||
r = self.wallet.receive_requests.get(addr)
|
r = self.wallet.receive_requests.get(addr)
|
||||||
|
@ -1209,6 +1208,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
||||||
description_label = HelpLabel(_('Description'), msg)
|
description_label = HelpLabel(_('Description'), msg)
|
||||||
grid.addWidget(description_label, 2, 0)
|
grid.addWidget(description_label, 2, 0)
|
||||||
self.message_e = MyLineEdit()
|
self.message_e = MyLineEdit()
|
||||||
|
self.message_e.setMinimumWidth(700)
|
||||||
grid.addWidget(self.message_e, 2, 1, 1, -1)
|
grid.addWidget(self.message_e, 2, 1, 1, -1)
|
||||||
|
|
||||||
msg = _('Amount to be sent.') + '\n\n' \
|
msg = _('Amount to be sent.') + '\n\n' \
|
||||||
|
@ -1227,12 +1227,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
||||||
lambda: self.fiat_send_e.setFrozen(self.amount_e.isReadOnly()))
|
lambda: self.fiat_send_e.setFrozen(self.amount_e.isReadOnly()))
|
||||||
|
|
||||||
self.max_button = EnterButton(_("Max"), self.spend_max)
|
self.max_button = EnterButton(_("Max"), self.spend_max)
|
||||||
self.max_button.setFixedWidth(self.amount_e.width())
|
self.max_button.setFixedWidth(100)
|
||||||
self.max_button.setCheckable(True)
|
self.max_button.setCheckable(True)
|
||||||
grid.addWidget(self.max_button, 3, 3)
|
grid.addWidget(self.max_button, 3, 3)
|
||||||
hbox = QHBoxLayout()
|
|
||||||
hbox.addStretch(1)
|
|
||||||
grid.addLayout(hbox, 3, 4)
|
|
||||||
|
|
||||||
self.from_label = QLabel(_('From'))
|
self.from_label = QLabel(_('From'))
|
||||||
grid.addWidget(self.from_label, 4, 0)
|
grid.addWidget(self.from_label, 4, 0)
|
||||||
|
@ -1347,13 +1344,14 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
||||||
self.preview_button.setToolTip(_('Display the details of your transaction before signing it.'))
|
self.preview_button.setToolTip(_('Display the details of your transaction before signing it.'))
|
||||||
self.send_button = EnterButton(_("Send"), self.do_pay)
|
self.send_button = EnterButton(_("Send"), self.do_pay)
|
||||||
self.clear_button = EnterButton(_("Clear"), self.do_clear)
|
self.clear_button = EnterButton(_("Clear"), self.do_clear)
|
||||||
|
|
||||||
buttons = QHBoxLayout()
|
buttons = QHBoxLayout()
|
||||||
buttons.addStretch(1)
|
buttons.addStretch(1)
|
||||||
buttons.addWidget(self.save_button)
|
|
||||||
buttons.addWidget(self.clear_button)
|
buttons.addWidget(self.clear_button)
|
||||||
|
buttons.addWidget(self.save_button)
|
||||||
buttons.addWidget(self.preview_button)
|
buttons.addWidget(self.preview_button)
|
||||||
buttons.addWidget(self.send_button)
|
buttons.addWidget(self.send_button)
|
||||||
grid.addLayout(buttons, 6, 1, 1, 3)
|
grid.addLayout(buttons, 6, 1, 1, 4)
|
||||||
|
|
||||||
self.amount_e.shortcut.connect(self.spend_max)
|
self.amount_e.shortcut.connect(self.spend_max)
|
||||||
self.payto_e.textChanged.connect(self.update_fee)
|
self.payto_e.textChanged.connect(self.update_fee)
|
||||||
|
@ -1415,6 +1413,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
||||||
vbox0.addLayout(grid)
|
vbox0.addLayout(grid)
|
||||||
hbox = QHBoxLayout()
|
hbox = QHBoxLayout()
|
||||||
hbox.addLayout(vbox0)
|
hbox.addLayout(vbox0)
|
||||||
|
hbox.addStretch(1)
|
||||||
w = QWidget()
|
w = QWidget()
|
||||||
vbox = QVBoxLayout(w)
|
vbox = QVBoxLayout(w)
|
||||||
vbox.addLayout(hbox)
|
vbox.addLayout(hbox)
|
||||||
|
@ -2017,8 +2016,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
||||||
self.show_send_tab_onchain_fees(b)
|
self.show_send_tab_onchain_fees(b)
|
||||||
|
|
||||||
def show_send_tab_onchain_fees(self, b: bool):
|
def show_send_tab_onchain_fees(self, b: bool):
|
||||||
self.feecontrol_fields.setVisible(b)
|
self.feecontrol_fields.setEnabled(b)
|
||||||
self.fee_e_label.setVisible(b)
|
#self.fee_e_label.setVisible(b)
|
||||||
|
|
||||||
def pay_to_URI(self, URI):
|
def pay_to_URI(self, URI):
|
||||||
if not URI:
|
if not URI:
|
||||||
|
|
|
@ -176,6 +176,7 @@ class RequestList(MyTreeView):
|
||||||
menu.addAction(_("Copy Request"), lambda: self.parent.do_copy('Lightning Request', req['invoice']))
|
menu.addAction(_("Copy Request"), lambda: self.parent.do_copy('Lightning Request', req['invoice']))
|
||||||
else:
|
else:
|
||||||
menu.addAction(_("Copy Request"), lambda: self.parent.do_copy('Bitcoin URI', req['URI']))
|
menu.addAction(_("Copy Request"), lambda: self.parent.do_copy('Bitcoin URI', req['URI']))
|
||||||
|
menu.addAction(_("Copy Address"), lambda: self.parent.do_copy('Bitcoin Address', req['address']))
|
||||||
if 'view_url' in req:
|
if 'view_url' in req:
|
||||||
menu.addAction(_("View in web browser"), lambda: webopen(req['view_url']))
|
menu.addAction(_("View in web browser"), lambda: webopen(req['view_url']))
|
||||||
menu.addAction(_("Delete"), lambda: self.parent.delete_request(key))
|
menu.addAction(_("Delete"), lambda: self.parent.delete_request(key))
|
||||||
|
|
Loading…
Add table
Reference in a new issue