From 9bbfd610be8457fb2911f963df3d0e8bca56a2c1 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 12 Dec 2018 19:58:13 +0100 Subject: [PATCH] qt: don't flash QWidgets on startup before main window is visible Consider wallet without password set. Using Qt GUI. When starting the app, before the main window appears, small artefacts ("minimised" windows?) would appear very briefly and then disappear. --- electrum/gui/qt/invoice_list.py | 6 ++++-- electrum/gui/qt/request_list.py | 13 +++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/electrum/gui/qt/invoice_list.py b/electrum/gui/qt/invoice_list.py index 4789aa066..111bf142a 100644 --- a/electrum/gui/qt/invoice_list.py +++ b/electrum/gui/qt/invoice_list.py @@ -58,8 +58,10 @@ class InvoiceList(MyTreeView): item[3].setFont(QFont(MONOSPACE_FONT)) self.addTopLevelItem(item) self.selectionModel().select(self.model().index(0,0), QItemSelectionModel.SelectCurrent) - self.setVisible(len(inv_list)) - self.parent.invoices_label.setVisible(len(inv_list)) + if self.parent.isVisible(): + b = len(inv_list) > 0 + self.setVisible(b) + self.parent.invoices_label.setVisible(b) def import_invoices(self): import_meta_gui(self.parent, _('invoices'), self.parent.invoices.import_file, self.update) diff --git a/electrum/gui/qt/request_list.py b/electrum/gui/qt/request_list.py index 8c6567fc8..79faca438 100644 --- a/electrum/gui/qt/request_list.py +++ b/electrum/gui/qt/request_list.py @@ -67,12 +67,13 @@ class RequestList(MyTreeView): def update(self): self.wallet = self.parent.wallet # hide receive tab if no receive requests available - b = len(self.wallet.receive_requests) > 0 - self.setVisible(b) - self.parent.receive_requests_label.setVisible(b) - if not b: - self.parent.expires_label.hide() - self.parent.expires_combo.show() + if self.parent.isVisible(): + b = len(self.wallet.receive_requests) > 0 + self.setVisible(b) + self.parent.receive_requests_label.setVisible(b) + if not b: + self.parent.expires_label.hide() + self.parent.expires_combo.show() # update the receive address if necessary current_address = self.parent.receive_address_e.text()