mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
fix
This commit is contained in:
parent
ce3808b948
commit
010579f20b
@ -1014,7 +1014,7 @@ class WebivewWidget(abstractwebview):
|
||||
webview_native_handle_kind_t.WEBVIEW_NATIVE_HANDLE_KIND_UI_WIDGET
|
||||
)
|
||||
|
||||
def __init__(self, parent=None, debug=True) -> None:
|
||||
def __init__(self, parent=None, debug=True, usedarklight=True) -> None:
|
||||
super().__init__(parent)
|
||||
declare_library_path(
|
||||
os.path.abspath(
|
||||
@ -1036,7 +1036,7 @@ class WebivewWidget(abstractwebview):
|
||||
self.keepref = [zoomfunc]
|
||||
self.webview.bind("__on_load", self._on_load)
|
||||
self.webview.init("""window.__on_load(window.location.href)""")
|
||||
|
||||
if usedarklight:
|
||||
self.__darkstate = None
|
||||
t = QTimer(self)
|
||||
t.setInterval(100)
|
||||
|
@ -46,7 +46,7 @@ class TextBrowser(QWidget, dataget):
|
||||
self.webivewwidget.on_load.connect(self.__loadextra)
|
||||
else:
|
||||
# webview2当会执行alert之类的弹窗js时,若qt窗口不可视,会卡住
|
||||
self.webivewwidget = WebivewWidget(self)
|
||||
self.webivewwidget = WebivewWidget(self, usedarklight=False)
|
||||
|
||||
# webview2无法接收qt事件。
|
||||
webviewhwnd = self.webivewwidget.get_hwnd()
|
||||
|
Loading…
x
Reference in New Issue
Block a user