From 4131700cea42e3068a388da98d77dcc151f22298 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, 27 Jun 2024 00:59:50 +0800 Subject: [PATCH] fix --- .../LunaTranslator/gui/setting_display_ui.py | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/setting_display_ui.py b/LunaTranslator/LunaTranslator/gui/setting_display_ui.py index 0aecbe1f..3ce11100 100644 --- a/LunaTranslator/LunaTranslator/gui/setting_display_ui.py +++ b/LunaTranslator/LunaTranslator/gui/setting_display_ui.py @@ -152,7 +152,10 @@ def checkthemesettingvisandapply_1(self, _dark): self.btnthemedark.hide() else: self.btnthemedark.show() - self.btnthemedark.clicked.disconnect() + try: + self.btnthemedark.clicked.disconnect() + except: + pass self.btnthemedark.clicked.connect(self.darksetting) else: @@ -162,7 +165,10 @@ def checkthemesettingvisandapply_1(self, _dark): self.btnthemelight.hide() else: self.btnthemelight.show() - self.btnthemelight.clicked.disconnect() + try: + self.btnthemelight.clicked.disconnect() + except: + pass self.btnthemelight.clicked.connect(self.lightsetting) except: @@ -177,7 +183,10 @@ def createbtnthemelight(self): if not self.lightsetting: self.btnthemelight.hide() else: - self.btnthemelight.clicked.disconnect() + try: + self.btnthemelight.clicked.disconnect() + except: + pass self.btnthemelight.clicked.connect(self.lightsetting) except: pass @@ -194,7 +203,10 @@ def createbtnthemedark(self): if not self.darksetting: self.btnthemedark.hide() else: - self.btnthemedark.clicked.disconnect() + try: + self.btnthemedark.clicked.disconnect() + except: + pass self.btnthemedark.clicked.connect(self.darksetting) except: pass