From 64a94e95225bdd62fd5aa8a6dec5ac27e03b9dae Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 27 Aug 2020 19:54:30 +0200 Subject: [PATCH] Qt Receive tab: hide "receive_tabs" widget when empty --- electrum/gui/qt/main_window.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index 1dde3e063..1be0eb25b 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -1147,6 +1147,14 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): receive_tabs.addTab(self.receive_qr, _('QR Code')) receive_tabs.setCurrentIndex(self.config.get('receive_tabs_index', 0)) receive_tabs.currentChanged.connect(lambda i: self.config.set_key('receive_tabs_index', i)) + receive_tabs_sp = receive_tabs.sizePolicy() + receive_tabs_sp.setRetainSizeWhenHidden(True) + receive_tabs.setSizePolicy(receive_tabs_sp) + + def maybe_hide_receive_tabs(): + receive_tabs.setVisible(bool(self.receive_payreq_e.text())) + self.receive_payreq_e.textChanged.connect(maybe_hide_receive_tabs) + maybe_hide_receive_tabs() # layout vbox_g = QVBoxLayout()