qt TxDialog: visibility of widgets should be set after parenting

widget.show() and widget.setVisible(True) results in a blink of an ephemeral window containing the widget;
that is, unless the widget has a parent explicitly set or it can be determined via which layout the widget is placed in.
This commit is contained in:
SomberNight 2019-12-12 21:31:30 +01:00
parent c9ede07462
commit dbd1c8cf71
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9

View file

@ -558,8 +558,6 @@ class BaseTxDialog(QDialog, MessageBoxMixin):
self.rbf_cb = QCheckBox(_('Replace by fee')) self.rbf_cb = QCheckBox(_('Replace by fee'))
self.rbf_cb.setChecked(bool(self.config.get('use_rbf', True))) self.rbf_cb.setChecked(bool(self.config.get('use_rbf', True)))
vbox_right.addWidget(self.rbf_cb) vbox_right.addWidget(self.rbf_cb)
self.rbf_label.setVisible(self.finalized)
self.rbf_cb.setVisible(not self.finalized)
self.locktime_label = TxDetailLabel() self.locktime_label = TxDetailLabel()
vbox_right.addWidget(self.locktime_label) vbox_right.addWidget(self.locktime_label)
@ -572,6 +570,10 @@ class BaseTxDialog(QDialog, MessageBoxMixin):
vbox.addLayout(hbox_stats) vbox.addLayout(hbox_stats)
# set visibility after parenting can be determined by Qt
self.rbf_label.setVisible(self.finalized)
self.rbf_cb.setVisible(not self.finalized)
def set_title(self): def set_title(self):
self.setWindowTitle(_("Create transaction") if not self.finalized else _("Transaction")) self.setWindowTitle(_("Create transaction") if not self.finalized else _("Transaction"))