This commit is contained in:
恍兮惚兮 2024-06-22 16:50:38 +08:00
parent 1ac57342e8
commit b806307288
4 changed files with 22 additions and 18 deletions

View File

@ -473,6 +473,10 @@ class MAINUI:
def starttextsource(self, use=None, checked=True): def starttextsource(self, use=None, checked=True):
self.translation_ui.showhidestate = False self.translation_ui.showhidestate = False
self.translation_ui.refreshtooliconsignal.emit() self.translation_ui.refreshtooliconsignal.emit()
for button in self.translation_ui.showbuttons:
button.show()
self.translation_ui.set_color_transparency()
try: try:
self.settin_ui.selectbutton.setEnabled( self.settin_ui.selectbutton.setEnabled(
globalconfig["sourcestatus2"]["texthook"]["use"] globalconfig["sourcestatus2"]["texthook"]["use"]
@ -635,7 +639,7 @@ class MAINUI:
def createedittextui(self): def createedittextui(self):
try: try:
self.edittextui = edittext(self.settin_ui, self.edittextui_cached) self.edittextui = edittext(self.commonstylebase, self.edittextui_cached)
if self.edittextui: if self.edittextui:
self.edittextui.show() self.edittextui.show()
except: except:
@ -652,7 +656,7 @@ class MAINUI:
def createattachprocess(self): def createattachprocess(self):
try: try:
self.AttachProcessDialog = AttachProcessDialog( self.AttachProcessDialog = AttachProcessDialog(
self.settin_ui, self.selectprocess, self.hookselectdialog self.commonstylebase, self.selectprocess, self.hookselectdialog
) )
if self.AttachProcessDialog: if self.AttachProcessDialog:
self.AttachProcessDialog.show() self.AttachProcessDialog.show()
@ -955,7 +959,7 @@ class MAINUI:
def inittray(self): def inittray(self):
trayMenu = QMenu(self.settin_ui) trayMenu = QMenu(self.commonstylebase)
showAction = QAction( showAction = QAction(
_TR("&显示"), _TR("&显示"),
trayMenu, trayMenu,
@ -965,7 +969,7 @@ class MAINUI:
qtawesome.icon("fa.gear"), qtawesome.icon("fa.gear"),
_TR("&设置"), _TR("&设置"),
trayMenu, trayMenu,
triggered=lambda: self.settin_ui.showsignal.emit(), triggered=lambda: self.commonstylebase.showsignal.emit(),
) )
quitAction = QAction( quitAction = QAction(
qtawesome.icon("fa.times"), qtawesome.icon("fa.times"),
@ -1028,7 +1032,7 @@ class MAINUI:
+ (globalconfig["settingfonttype"]) + (globalconfig["settingfonttype"])
+ "' ; }" + "' ; }"
) )
self.__commonstylebase.setStyleSheet(style) self.commonstylebase.setStyleSheet(style)
def loadui(self): def loadui(self):
self.installeventfillter() self.installeventfillter()
@ -1043,13 +1047,13 @@ class MAINUI:
self.startxiaoxueguan() self.startxiaoxueguan()
self.starthira() self.starthira()
self.startoutputer() self.startoutputer()
self.__commonstylebase = commonstylebase(self.translation_ui) self.commonstylebase = commonstylebase(self.translation_ui)
self.setcommonstylesheet() self.setcommonstylesheet()
self.settin_ui = Setting(self.__commonstylebase) self.settin_ui = Setting(self.commonstylebase)
self.transhis = transhist(self.settin_ui) self.transhis = transhist(self.commonstylebase)
self.startreader() self.startreader()
self.searchwordW = searchwordW(self.settin_ui) self.searchwordW = searchwordW(self.commonstylebase)
self.hookselectdialog = hookselect(self.settin_ui) self.hookselectdialog = hookselect(self.commonstylebase)
self.starttextsource() self.starttextsource()
threading.Thread(target=self.autocheckhwndexists).start() threading.Thread(target=self.autocheckhwndexists).start()
threading.Thread(target=self.autohookmonitorthread).start() threading.Thread(target=self.autohookmonitorthread).start()
@ -1067,7 +1071,7 @@ class MAINUI:
# 会触发两次 # 会触发两次
windows.WaitForSingleObject(sema, windows.INFINITE) windows.WaitForSingleObject(sema, windows.INFINITE)
if globalconfig["darklight2"] == 0: if globalconfig["darklight2"] == 0:
self.__commonstylebase.setstylesheetsignal.emit() self.commonstylebase.setstylesheetsignal.emit()
windows.WaitForSingleObject(sema, windows.INFINITE) windows.WaitForSingleObject(sema, windows.INFINITE)
def installeventfillter(self): def installeventfillter(self):

View File

@ -634,7 +634,7 @@ class dialog_setting_game_internal(QWidget):
self.editpath, self.editpath,
getIconButton(functools.partial(self.selectexe), icon="fa.gear"), getIconButton(functools.partial(self.selectexe), icon="fa.gear"),
getIconButton( getIconButton(
lambda: browserdialog(gobject.baseobject.settin_ui, exepath), lambda: browserdialog(gobject.baseobject.commonstylebase, exepath),
icon="fa.book", icon="fa.book",
), ),
] ]

View File

@ -320,7 +320,7 @@ class QUnFrameWindow(resizableframeless):
lambda: winsharedutils.clipboard_set(gobject.baseobject.currenttext), lambda: winsharedutils.clipboard_set(gobject.baseobject.currenttext),
), ),
("edit", gobject.baseobject.createedittextui), ("edit", gobject.baseobject.createedittextui),
("edittrans", lambda: edittrans(gobject.baseobject.settin_ui)), ("edittrans", lambda: edittrans(gobject.baseobject.commonstylebase)),
("showraw", self.changeshowhideraw), ("showraw", self.changeshowhideraw),
("history", lambda: gobject.baseobject.transhis.showsignal.emit()), ("history", lambda: gobject.baseobject.transhis.showsignal.emit()),
( (
@ -341,7 +341,7 @@ class QUnFrameWindow(resizableframeless):
("locktoolsbutton", self.changetoolslockstate), ("locktoolsbutton", self.changetoolslockstate),
( (
"gamepad_new", "gamepad_new",
lambda: dialog_savedgame_integrated(gobject.baseobject.settin_ui), lambda: dialog_savedgame_integrated(gobject.baseobject.commonstylebase),
), ),
( (
"selectgame", "selectgame",
@ -360,7 +360,7 @@ class QUnFrameWindow(resizableframeless):
( (
"memory", "memory",
lambda: dialog_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", "open_relative_link",
lambda: browserdialog( lambda: browserdialog(
gobject.baseobject.settin_ui, gobject.baseobject.commonstylebase,
trypass(lambda: gobject.baseobject.textsource.pname)(), trypass(lambda: gobject.baseobject.textsource.pname)(),
), ),
), ),
@ -545,7 +545,7 @@ class QUnFrameWindow(resizableframeless):
self.displayraw1.connect(self.showraw) self.displayraw1.connect(self.showraw)
self.refreshtooliconsignal.connect(self.refreshtoolicon) self.refreshtooliconsignal.connect(self.refreshtoolicon)
self.showsavegame_signal.connect( 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.clickRange_signal.connect(self.clickRange)
self.showhide_signal.connect(self.showhideocrrange) self.showhide_signal.connect(self.showhideocrrange)

View File

@ -1114,7 +1114,7 @@ class QWebWrap(abstractwebview):
def __init__(_self) -> None: def __init__(_self) -> None:
super().__init__( super().__init__(
gobject.baseobject.settin_ui, gobject.baseobject.commonstylebase,
poslist=globalconfig["qwebinspectgeo"], poslist=globalconfig["qwebinspectgeo"],
) )
_self.setWindowTitle("Inspect") _self.setWindowTitle("Inspect")