commit 64a94e95225bdd62fd5aa8a6dec5ac27e03b9dae
parent 5d723401f851a07129620addceb0f1f2d80f7b95
Author: SomberNight <somber.night@protonmail.com>
Date: Thu, 27 Aug 2020 19:54:30 +0200
Qt Receive tab: hide "receive_tabs" widget when empty
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git 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()