commit 13dca30428bf871c6683d826883d75d7945bc92d
parent 4216a9164d0eb30e58bfef4e0c6039dd486e0263
Author: SomberNight <somber.night@protonmail.com>
Date: Thu, 25 Jun 2020 22:03:40 +0200
mac/qt: fix some refresh bugs in swap_dialog and new_channel_dialog
fixes #6269
this is just ugly :/
Diffstat:
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/electrum/gui/qt/amountedit.py b/electrum/gui/qt/amountedit.py
@@ -112,6 +112,7 @@ class BTCAmountEdit(AmountEdit):
self.setText(" ") # Space forces repaint in case units changed
else:
self.setText(format_satoshis_plain(amount_sat, decimal_point=self.decimal_point()))
+ self.repaint() # macOS hack for #6269
class FeerateEdit(BTCAmountEdit):
diff --git a/electrum/gui/qt/channels_list.py b/electrum/gui/qt/channels_list.py
@@ -337,13 +337,19 @@ class ChannelsList(MyTreeView):
max_button.setFixedWidth(100)
max_button.setCheckable(True)
suggest_button = QPushButton(d, text=_('Suggest'))
- suggest_button.clicked.connect(lambda: remote_nodeid.setText(bh2u(lnworker.suggest_peer() or b'')))
+ def on_suggest():
+ remote_nodeid.setText(bh2u(lnworker.suggest_peer() or b''))
+ remote_nodeid.repaint() # macOS hack for #6269
+ suggest_button.clicked.connect(on_suggest)
clear_button = QPushButton(d, text=_('Clear'))
def on_clear():
amount_e.setText('')
amount_e.setFrozen(False)
+ amount_e.repaint() # macOS hack for #6269
remote_nodeid.setText('')
+ remote_nodeid.repaint() # macOS hack for #6269
max_button.setChecked(False)
+ max_button.repaint() # macOS hack for #6269
clear_button.clicked.connect(on_clear)
h = QGridLayout()
h.addWidget(QLabel(_('Your Node ID')), 0, 0)
diff --git a/electrum/gui/qt/swap_dialog.py b/electrum/gui/qt/swap_dialog.py
@@ -163,10 +163,13 @@ class SwapDialog(WindowModalDialog):
def update(self):
sm = self.swap_manager
self.send_button.setIcon(read_QIcon("lightning.png" if self.is_reverse else "bitcoin.png"))
+ self.send_button.repaint() # macOS hack for #6269
self.recv_button.setIcon(read_QIcon("lightning.png" if not self.is_reverse else "bitcoin.png"))
+ self.recv_button.repaint() # macOS hack for #6269
server_mining_fee = sm.lockup_fee if self.is_reverse else sm.normal_fee
server_fee_str = '%.2f'%sm.percentage + '% + ' + self.window.format_amount(server_mining_fee) + ' ' + self.window.base_unit()
self.server_fee_label.setText(server_fee_str)
+ self.server_fee_label.repaint() # macOS hack for #6269
self.update_fee()
def update_fee(self):
@@ -185,6 +188,7 @@ class SwapDialog(WindowModalDialog):
fee = self.tx.get_fee() if self.tx else None
fee_text = self.window.format_amount(fee) + ' ' + self.window.base_unit() if fee else ''
self.fee_label.setText(fee_text)
+ self.fee_label.repaint() # macOS hack for #6269
def run(self):
self.window.run_coroutine_from_thread(self.swap_manager.get_pairs(), lambda x: self.update())