From b8063072883a0df12f468a541d22defeb52b1651 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: Sat, 22 Jun 2024 16:50:38 +0800 Subject: [PATCH] fix --- .../LunaTranslator/LunaTranslator.py | 26 +++++++++++-------- .../LunaTranslator/gui/dialog_savedgame.py | 2 +- .../LunaTranslator/gui/translatorUI.py | 10 +++---- .../LunaTranslator/gui/usefulwidget.py | 2 +- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/LunaTranslator/LunaTranslator/LunaTranslator.py b/LunaTranslator/LunaTranslator/LunaTranslator.py index f7abebf5..96ecd91a 100644 --- a/LunaTranslator/LunaTranslator/LunaTranslator.py +++ b/LunaTranslator/LunaTranslator/LunaTranslator.py @@ -473,6 +473,10 @@ class MAINUI: def starttextsource(self, use=None, checked=True): self.translation_ui.showhidestate = False self.translation_ui.refreshtooliconsignal.emit() + + for button in self.translation_ui.showbuttons: + button.show() + self.translation_ui.set_color_transparency() try: self.settin_ui.selectbutton.setEnabled( globalconfig["sourcestatus2"]["texthook"]["use"] @@ -635,7 +639,7 @@ class MAINUI: def createedittextui(self): try: - self.edittextui = edittext(self.settin_ui, self.edittextui_cached) + self.edittextui = edittext(self.commonstylebase, self.edittextui_cached) if self.edittextui: self.edittextui.show() except: @@ -652,7 +656,7 @@ class MAINUI: def createattachprocess(self): try: self.AttachProcessDialog = AttachProcessDialog( - self.settin_ui, self.selectprocess, self.hookselectdialog + self.commonstylebase, self.selectprocess, self.hookselectdialog ) if self.AttachProcessDialog: self.AttachProcessDialog.show() @@ -955,7 +959,7 @@ class MAINUI: def inittray(self): - trayMenu = QMenu(self.settin_ui) + trayMenu = QMenu(self.commonstylebase) showAction = QAction( _TR("&显示"), trayMenu, @@ -965,7 +969,7 @@ class MAINUI: qtawesome.icon("fa.gear"), _TR("&设置"), trayMenu, - triggered=lambda: self.settin_ui.showsignal.emit(), + triggered=lambda: self.commonstylebase.showsignal.emit(), ) quitAction = QAction( qtawesome.icon("fa.times"), @@ -1028,7 +1032,7 @@ class MAINUI: + (globalconfig["settingfonttype"]) + "' ; }" ) - self.__commonstylebase.setStyleSheet(style) + self.commonstylebase.setStyleSheet(style) def loadui(self): self.installeventfillter() @@ -1043,13 +1047,13 @@ class MAINUI: self.startxiaoxueguan() self.starthira() self.startoutputer() - self.__commonstylebase = commonstylebase(self.translation_ui) + self.commonstylebase = commonstylebase(self.translation_ui) self.setcommonstylesheet() - self.settin_ui = Setting(self.__commonstylebase) - self.transhis = transhist(self.settin_ui) + self.settin_ui = Setting(self.commonstylebase) + self.transhis = transhist(self.commonstylebase) self.startreader() - self.searchwordW = searchwordW(self.settin_ui) - self.hookselectdialog = hookselect(self.settin_ui) + self.searchwordW = searchwordW(self.commonstylebase) + self.hookselectdialog = hookselect(self.commonstylebase) self.starttextsource() threading.Thread(target=self.autocheckhwndexists).start() threading.Thread(target=self.autohookmonitorthread).start() @@ -1067,7 +1071,7 @@ class MAINUI: # 会触发两次 windows.WaitForSingleObject(sema, windows.INFINITE) if globalconfig["darklight2"] == 0: - self.__commonstylebase.setstylesheetsignal.emit() + self.commonstylebase.setstylesheetsignal.emit() windows.WaitForSingleObject(sema, windows.INFINITE) def installeventfillter(self): diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py index db87fa66..4c0caad0 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py @@ -634,7 +634,7 @@ class dialog_setting_game_internal(QWidget): self.editpath, getIconButton(functools.partial(self.selectexe), icon="fa.gear"), getIconButton( - lambda: browserdialog(gobject.baseobject.settin_ui, exepath), + lambda: browserdialog(gobject.baseobject.commonstylebase, exepath), icon="fa.book", ), ] diff --git a/LunaTranslator/LunaTranslator/gui/translatorUI.py b/LunaTranslator/LunaTranslator/gui/translatorUI.py index 27d6e141..6fcecafe 100644 --- a/LunaTranslator/LunaTranslator/gui/translatorUI.py +++ b/LunaTranslator/LunaTranslator/gui/translatorUI.py @@ -320,7 +320,7 @@ class QUnFrameWindow(resizableframeless): lambda: winsharedutils.clipboard_set(gobject.baseobject.currenttext), ), ("edit", gobject.baseobject.createedittextui), - ("edittrans", lambda: edittrans(gobject.baseobject.settin_ui)), + ("edittrans", lambda: edittrans(gobject.baseobject.commonstylebase)), ("showraw", self.changeshowhideraw), ("history", lambda: gobject.baseobject.transhis.showsignal.emit()), ( @@ -341,7 +341,7 @@ class QUnFrameWindow(resizableframeless): ("locktoolsbutton", self.changetoolslockstate), ( "gamepad_new", - lambda: dialog_savedgame_integrated(gobject.baseobject.settin_ui), + lambda: dialog_savedgame_integrated(gobject.baseobject.commonstylebase), ), ( "selectgame", @@ -360,7 +360,7 @@ class QUnFrameWindow(resizableframeless): ( "memory", lambda: dialog_memory( - gobject.baseobject.settin_ui, gobject.baseobject.currentmd5 + gobject.baseobject.commonstylebase, gobject.baseobject.currentmd5 ), ), ( @@ -389,7 +389,7 @@ class QUnFrameWindow(resizableframeless): ( "open_relative_link", lambda: browserdialog( - gobject.baseobject.settin_ui, + gobject.baseobject.commonstylebase, trypass(lambda: gobject.baseobject.textsource.pname)(), ), ), @@ -545,7 +545,7 @@ class QUnFrameWindow(resizableframeless): self.displayraw1.connect(self.showraw) self.refreshtooliconsignal.connect(self.refreshtoolicon) self.showsavegame_signal.connect( - lambda: dialog_savedgame_integrated(gobject.baseobject.settin_ui) + lambda: dialog_savedgame_integrated(gobject.baseobject.commonstylebase) ) self.clickRange_signal.connect(self.clickRange) self.showhide_signal.connect(self.showhideocrrange) diff --git a/LunaTranslator/LunaTranslator/gui/usefulwidget.py b/LunaTranslator/LunaTranslator/gui/usefulwidget.py index 2ff11e3b..aad4c926 100644 --- a/LunaTranslator/LunaTranslator/gui/usefulwidget.py +++ b/LunaTranslator/LunaTranslator/gui/usefulwidget.py @@ -1114,7 +1114,7 @@ class QWebWrap(abstractwebview): def __init__(_self) -> None: super().__init__( - gobject.baseobject.settin_ui, + gobject.baseobject.commonstylebase, poslist=globalconfig["qwebinspectgeo"], ) _self.setWindowTitle("Inspect")