From 0e80480113d7f61890b4f151864a2056592d53fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Thu, 30 May 2024 18:56:53 +0800 Subject: [PATCH] delayload --- LunaTranslator/LunaTranslator/gui/showword.py | 2 +- LunaTranslator/LunaTranslator/gui/usefulwidget.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/showword.py b/LunaTranslator/LunaTranslator/gui/showword.py index bcd60368..7cea4a3d 100644 --- a/LunaTranslator/LunaTranslator/gui/showword.py +++ b/LunaTranslator/LunaTranslator/gui/showword.py @@ -719,7 +719,7 @@ class searchwordW(closeashidewindow): super(searchwordW, self).__init__(parent, globalconfig, "sw_geo") # self.setWindowFlags(self.windowFlags()&~Qt.WindowMinimizeButtonHint) self.getnewsentencesignal.connect(self.getnewsentence) - + self.setWindowTitle(_TR("查词")) self.ankiwindow = AnkiWindow() self.setupUi() diff --git a/LunaTranslator/LunaTranslator/gui/usefulwidget.py b/LunaTranslator/LunaTranslator/gui/usefulwidget.py index 2850ee5c..b52b2005 100644 --- a/LunaTranslator/LunaTranslator/gui/usefulwidget.py +++ b/LunaTranslator/LunaTranslator/gui/usefulwidget.py @@ -677,12 +677,14 @@ class auto_select_webview(QWidget): super().__init__(parent) self.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding) self.cantusewebview2 = False - self.internal = None + self.internal = ( + QWidget() + ) # 加个占位的widget,否则等待加载的时候有一瞬间的灰色背景。 self.contex = -1 layout = QHBoxLayout() layout.setContentsMargins(0, 0, 0, 0) + layout.addWidget(self.internal) self.setLayout(layout) - self._maybecreate() self.lastcachehtml = None def _maybecreate(self):