This commit is contained in:
恍兮惚兮 2024-08-10 17:07:09 +08:00
parent 4b5a51f093
commit 2ab37d4a90
4 changed files with 36 additions and 1 deletions

View File

@ -38,6 +38,9 @@ def __changeuibuttonstate(self, x):
except:
pass
def __changeuibuttonstate2(self, x):
gobject.baseobject.translation_ui.refreshtoolicon()
def createtextfontcom(key):
font_comboBox = FocusFontCombo()
@ -361,7 +364,13 @@ def xianshigrid_text(self):
],
[
"显示翻译",
D_getsimpleswitch(globalconfig, "showfanyi"),
D_getsimpleswitch(
globalconfig,
"showfanyi",
callback=lambda x: __changeuibuttonstate2(self, x),
name="show_fany_switch",
parent=self,
),
"",
("显示翻译器名称"),
D_getsimpleswitch(globalconfig, "showfanyisource"),

View File

@ -44,6 +44,7 @@ def registrhotkeys(self):
"_3": self.showsignal.emit,
"_4": lambda: winsharedutils.clipboard_set(gobject.baseobject.currenttext),
"_5": gobject.baseobject.translation_ui.changeshowhideraw,
"_51":gobject.baseobject.translation_ui.changeshowhidetrans,
"_6": lambda: gobject.baseobject.transhis.showsignal.emit(),
"_7": lambda: gobject.baseobject.readcurrent(force=True),
"_8": lambda: gobject.baseobject.translation_ui.changemousetransparentstate(0),

View File

@ -511,6 +511,12 @@ class QUnFrameWindow(resizableframeless):
lambda: globalconfig["isshowrawtext"],
lambda: globalconfig["isshowrawtext"],
),
(
"showtrans",
self.changeshowhidetrans,
lambda: globalconfig["showfanyi"],
lambda: globalconfig["showfanyi"],
),
("history", lambda: gobject.baseobject.transhis.showsignal.emit()),
(
"noundict",
@ -1064,6 +1070,13 @@ class QUnFrameWindow(resizableframeless):
globalconfig["isshowrawtext"] = not globalconfig["isshowrawtext"]
self.refreshtoolicon()
def changeshowhidetrans(self):
try:
gobject.baseobject.settin_ui.show_fany_switch.clicksignal.emit()
except:
globalconfig["showfanyi"] = not globalconfig["showfanyi"]
self.refreshtoolicon()
def changeTranslateMode(self):
globalconfig["autorun"] = not globalconfig["autorun"]
self.refreshtoolicon()

View File

@ -756,6 +756,13 @@
"icon2": "fa.eye-slash",
"align": 2
},
"showtrans": {
"use": false,
"tip": "显示/隐藏翻译",
"icon": "fa.eye",
"icon2": "fa.eye-slash",
"align": 2
},
"langdu": {
"use": true,
"tip": "朗读",
@ -920,6 +927,11 @@
"name": "显示/隐藏原文",
"keystring": ""
},
"_51": {
"use": false,
"name": "显示/隐藏翻译",
"keystring": ""
},
"_6": {
"use": false,
"name": "显示/隐藏历史翻译",