Browse Source

qt: fix some widget parenting issues

If you force-show a widget (e.g. `w.setVisible(True)`) before parenting it,
a small window will flash (appear and disappear) for a fraction of second,
which is a bit irritating.
patch-4
SomberNight 4 years ago
parent
commit
349a033ce6
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 8
      electrum/gui/qt/main_window.py
  2. 3
      electrum/gui/qt/password_dialog.py

8
electrum/gui/qt/main_window.py

@ -1028,9 +1028,10 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
self.history_model.set_view(self.history_list)
l.searchable_list = l
toolbar = l.create_toolbar(self.config)
tab = self.create_list_tab(l, toolbar)
toolbar_shown = bool(self.config.get('show_toolbar_history', False))
l.show_toolbar(toolbar_shown)
return self.create_list_tab(l, toolbar)
return tab
def show_address(self, addr):
from . import address_dialog
@ -2032,9 +2033,10 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
from .address_list import AddressList
self.address_list = l = AddressList(self)
toolbar = l.create_toolbar(self.config)
tab = self.create_list_tab(l, toolbar)
toolbar_shown = bool(self.config.get('show_toolbar_addresses', False))
l.show_toolbar(toolbar_shown)
return self.create_list_tab(l, toolbar)
return tab
def create_utxo_tab(self):
from .utxo_list import UTXOList
@ -2247,8 +2249,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
self.seed_button = StatusBarButton(read_QIcon("seed.png"), _("Seed"), self.show_seed_dialog)
sb.addPermanentWidget(self.seed_button)
self.lightning_button = StatusBarButton(read_QIcon("lightning.png"), _("Lightning Network"), self.gui_object.show_lightning_dialog)
self.update_lightning_icon()
sb.addPermanentWidget(self.lightning_button)
self.update_lightning_icon()
self.status_button = None
if self.network:
self.status_button = StatusBarButton(read_QIcon("status_disconnected.png"), _("Network"), self.gui_object.show_network_dialog)

3
electrum/gui/qt/password_dialog.py

@ -124,7 +124,8 @@ class PasswordLayout(object):
self.encrypt_cb = QCheckBox(_('Encrypt wallet file'))
self.encrypt_cb.setEnabled(False)
grid.addWidget(self.encrypt_cb, 4, 0, 1, 2)
self.encrypt_cb.setVisible(kind != PW_PASSPHRASE)
if kind == PW_PASSPHRASE:
self.encrypt_cb.setVisible(False)
def enable_OK():
ok = self.new_pw.text() == self.conf_pw.text()

Loading…
Cancel
Save