From d8e0df5859a59949f6991a772a24a19acf3a266b 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: Wed, 26 Jun 2024 19:53:48 +0800 Subject: [PATCH] fix --- LunaTranslator/LunaTranslator/gui/selecthook.py | 2 ++ LunaTranslator/LunaTranslator/gui/specialwidget.py | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/selecthook.py b/LunaTranslator/LunaTranslator/gui/selecthook.py index 5afc18d4..dc042f0a 100644 --- a/LunaTranslator/LunaTranslator/gui/selecthook.py +++ b/LunaTranslator/LunaTranslator/gui/selecthook.py @@ -375,6 +375,8 @@ class hookselect(closeashidewindow): def __init__(self, parent): super(hookselect, self).__init__(parent, globalconfig["selecthookgeo"]) self.setupUi() + self.save = [] + self.hidesearchhookbuttons() self.changeprocessclearsignal.connect(self.changeprocessclear) self.removehooksignal.connect(self.removehook) self.addnewhooksignal.connect(self.addnewhook) diff --git a/LunaTranslator/LunaTranslator/gui/specialwidget.py b/LunaTranslator/LunaTranslator/gui/specialwidget.py index 05f9a73d..e8902b6d 100644 --- a/LunaTranslator/LunaTranslator/gui/specialwidget.py +++ b/LunaTranslator/LunaTranslator/gui/specialwidget.py @@ -311,8 +311,7 @@ class lazyscrollflow(ScrollArea): def directshow(self): QApplication.processEvents() - if len(self.internalwid.visibleRegion().rects()): - self.doshowlazywidget(True, self.internalwid.visibleRegion().rects()[0]) + self.doshowlazywidget(True, self.internalwid.visibleRegion().boundingRect()) def __init__(self): super().__init__() @@ -624,11 +623,11 @@ class stackedlist(ScrollArea): def directshow(self): QApplication.processEvents() - self.doshowlazywidget(True, self.internal.visibleRegion().rects()[0]) + self.doshowlazywidget(True, self.internal.visibleRegion().boundingRect()) def resizeEvent(self, e: QResizeEvent): try: - self.doshowlazywidget(False, self.internal.visibleRegion().rects()[0]) + self.doshowlazywidget(False, self.internal.visibleRegion().boundingRect()) except: pass return super().resizeEvent(e)