forked from bitcoinafterlife/bal-electrum-plugin
v0.5.1: fix Windows Settings-dialog flicker
This commit is contained in:
@@ -378,29 +378,28 @@ class Plugin(BalPlugin):
|
|||||||
lbl_logo = QLabel()
|
lbl_logo = QLabel()
|
||||||
lbl_logo.setPixmap(qicon)
|
lbl_logo.setPixmap(qicon)
|
||||||
|
|
||||||
# WINDOWS FLICKER FIX (root cause found by bisection with the owner
|
# WINDOWS FLICKER FIX (root cause found by bisection, tested on Windows
|
||||||
# testing on Windows): the ADVANCED-only rows used to be added to the
|
# by the user): the ADVANCED-only rows below used to be added to the
|
||||||
# grid *visible* and then hidden all at once with setVisible(False)
|
# grid *visible* and then hidden all at once with setVisible(False)
|
||||||
# AFTER they were already in the layout (see the old block near the
|
# AFTER they were already part of the layout. On Windows that
|
||||||
# end of this function). On Windows that visible->hidden transition,
|
# visible->hidden transition, inside an already-populated layout while
|
||||||
# happening inside an already-populated layout while the dialog's
|
# the dialog's native window is being created, forced a live re-layout
|
||||||
# native window is being created, forced a live re-layout that flashed
|
# that flashed the dialog on screen (the "ghost window" flicker). It
|
||||||
# the dialog on screen (the "ghost window" the owner saw). It only
|
# only showed in ADVANCED mode because that is the larger dialog. The
|
||||||
# showed in ADVANCED because that is the larger dialog. The fix,
|
# fix, validated step by step on Windows, is to set each ADVANCED-only
|
||||||
# validated step by step on Windows, is to set each ADVANCED-only
|
|
||||||
# widget's visibility BEFORE it is ever added to the layout, so it
|
# widget's visibility BEFORE it is ever added to the layout, so it
|
||||||
# never transitions visible->hidden inside a live layout.
|
# never transitions visible->hidden inside a live layout.
|
||||||
#
|
#
|
||||||
# ``basic_init`` is the current mode; ``_hide_if_basic(w)`` hides a
|
# ``basic_init`` is the current mode; ``_hide_if_basic(w)`` hides a
|
||||||
# widget immediately (at creation time) when in BASIC mode and returns
|
# widget immediately (at creation/add time) when in BASIC mode and
|
||||||
# it, so it can be wrapped around each ADVANCED-only widget inline.
|
# returns it, so it can be wrapped inline around each ADVANCED-only
|
||||||
|
# widget at its grid.addWidget(...) call.
|
||||||
basic_init = str(self.USER_TYPE.get()).lower() != "advanced"
|
basic_init = str(self.USER_TYPE.get()).lower() != "advanced"
|
||||||
|
|
||||||
def _hide_if_basic(w):
|
def _hide_if_basic(w):
|
||||||
"""Hide *w* now (before it is added to any layout) if in BASIC
|
"""Hide *w* now (before it is added to any layout) if in BASIC
|
||||||
mode, and return it. Used to give ADVANCED-only widgets their
|
mode, and return it. Avoids the Windows relayout flicker that a
|
||||||
final visibility up-front, avoiding the Windows relayout flicker
|
later setVisible(False) inside the populated grid caused."""
|
||||||
that a later setVisible(False) inside the populated grid caused."""
|
|
||||||
if basic_init:
|
if basic_init:
|
||||||
w.setVisible(False)
|
w.setVisible(False)
|
||||||
return w
|
return w
|
||||||
|
|||||||
Reference in New Issue
Block a user