Browse Source
mac/qt: fix some refresh bugs in swap_dialog and new_channel_dialog
fixes #6269
this is just ugly :/
bip39-recovery
SomberNight
5 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
3 changed files with
12 additions and
1 deletions
-
electrum/gui/qt/amountedit.py
-
electrum/gui/qt/channels_list.py
-
electrum/gui/qt/swap_dialog.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): |
|
|
|
|
|
@ -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) |
|
|
|
|
|
@ -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()) |
|
|
|