This commit is contained in:
恍兮惚兮 2024-07-11 16:31:24 +08:00
parent 17c808f241
commit ecac492a77
3 changed files with 39 additions and 31 deletions

View File

@ -1146,8 +1146,16 @@ class MAINUI:
""" """
self.commonstylebase.setStyleSheet(style) self.commonstylebase.setStyleSheet(style)
def parsedefaultfont(self):
for k in ["fonttype", "fonttype2"]:
if globalconfig[k] == "":
globalconfig[k] = QFontDatabase.systemFont(
QFontDatabase.SystemFont.GeneralFont
).family()
def loadui(self): def loadui(self):
self.installeventfillter() self.installeventfillter()
self.parsedefaultfont()
self.translation_ui = QUnFrameWindow() self.translation_ui = QUnFrameWindow()
self.translation_ui.show() self.translation_ui.show()
self.translation_ui.aftershowdosomething() self.translation_ui.aftershowdosomething()

View File

@ -1166,7 +1166,7 @@ class mshtmlWidget(abstractwebview):
def _parsehtml(self, html): def _parsehtml(self, html):
html = self._parsehtml_dark(html) html = self._parsehtml_dark(html)
html = """<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /></head><body style=" font-family:'{}'">{}</body></html>""".format( html = """<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /></head><body style=" font-family:'{}'">{}</body></html>""".format(
QFontDatabase.systemFont(QFontDatabase.GeneralFont).family(), html QFontDatabase.systemFont(QFontDatabase.SystemFont.GeneralFont).family(), html
) )
return html return html

View File

@ -8,7 +8,7 @@
"only_from_exe": [], "only_from_exe": [],
"showrangeafterrangeselect": true, "showrangeafterrangeselect": true,
"autodisappear": false, "autodisappear": false,
"WindowBackdrop": 0, "WindowBackdrop": 3,
"WindowEffect": 0, "WindowEffect": 0,
"read_raw": true, "read_raw": true,
"global_list_opened": true, "global_list_opened": true,
@ -348,7 +348,7 @@
"textthreaddelay": 500, "textthreaddelay": 500,
"maxBufferSize": 3000, "maxBufferSize": 3000,
"maxHistorySize": 1000000, "maxHistorySize": 1000000,
"yuanjiao_r": 0, "yuanjiao_r": 5,
"qwebinspectgeo": [ "qwebinspectgeo": [
100, 100,
100, 100,
@ -438,8 +438,6 @@
"ocr_text_diff": 3, "ocr_text_diff": 3,
"autorun": true, "autorun": true,
"usewebview": 1, "usewebview": 1,
"transparent": 80,
"transparent_tool": 50,
"fontsize": 17.0, "fontsize": 17.0,
"fontsizeori": 17.0, "fontsizeori": 17.0,
"localeswitchmethod": 0, "localeswitchmethod": 0,
@ -447,15 +445,17 @@
"startgamenototop": true, "startgamenototop": true,
"showgametitle": true, "showgametitle": true,
"extra_space": 0, "extra_space": 0,
"fonttype": "Arial", "fonttype": "",
"fonttype2": "Arial", "fonttype2": "",
"hira_vis_type": 0, "hira_vis_type": 0,
"iskongxin": true, "iskongxin": true,
"isshowrawtext": true, "isshowrawtext": true,
"kanarate": 0.5, "kanarate": 0.5,
"rawtextcolor": "#000000", "rawtextcolor": "#000000",
"backcolor": "#3f3f3f", "backcolor": "#000000",
"backcolor_tool": "#3f3f3f", "transparent": 27,
"backcolor_tool": "#000000",
"transparent_tool": 27,
"isshowhira": false, "isshowhira": false,
"locktools": true, "locktools": true,
"extendtools": true, "extendtools": true,
@ -516,10 +516,10 @@
"accept_use_unicode_start": 0, "accept_use_unicode_start": 0,
"accept_use_unicode_end": 65535, "accept_use_unicode_end": 65535,
"premtsimiuse": false, "premtsimiuse": false,
"buttoncolor": "#001f9f", "buttoncolor": "#2e2eff",
"buttoncolor2": "#FF69B4", "buttoncolor2": "#FF69B4",
"buttoncolor3": "#afafaf", "buttoncolor3": "#afafaf",
"buttoncolor_1": "#FF69B4", "buttoncolor_1": "#ff03f2",
"premtsimi2": 100, "premtsimi2": 100,
"ocrrangecolor": "#000000", "ocrrangecolor": "#000000",
"ocrrangewidth": 2, "ocrrangewidth": 2,
@ -587,20 +587,20 @@
"use": true, "use": true,
"tip": "手动翻译", "tip": "手动翻译",
"icon": "fa.rotate-right", "icon": "fa.rotate-right",
"align": 0 "align": 2
}, },
"automodebutton": { "automodebutton": {
"use": true, "use": true,
"tip": "自动翻译", "tip": "自动翻译",
"icon": "fa.forward", "icon": "fa.forward",
"icon2": "fa.play", "icon2": "fa.play",
"align": 0 "align": 2
}, },
"setting": { "setting": {
"use": true, "use": true,
"tip": "打开设置", "tip": "打开设置",
"icon": "fa.gear", "icon": "fa.gear",
"align": 0 "align": 2
}, },
"copy_once": { "copy_once": {
"use": false, "use": false,
@ -624,20 +624,20 @@
"use": true, "use": true,
"tip": "鼠标穿透窗口", "tip": "鼠标穿透窗口",
"icon": "fa.mouse-pointer", "icon": "fa.mouse-pointer",
"align": 0 "align": 2
}, },
"backtransbutton": { "backtransbutton": {
"use": true, "use": true,
"tip": "背景窗口透明", "tip": "背景窗口透明",
"icon": "fa.lightbulb-o", "icon": "fa.lightbulb-o",
"align": 0 "align": 2
}, },
"locktoolsbutton": { "locktoolsbutton": {
"use": true, "use": true,
"tip": "锁定工具栏", "tip": "锁定工具栏",
"icon": "fa.lock", "icon": "fa.lock",
"icon2": "fa.unlock", "icon2": "fa.unlock",
"align": 0 "align": 2
}, },
"selectgame": { "selectgame": {
"use": true, "use": true,
@ -646,7 +646,7 @@
"texthook" "texthook"
], ],
"icon": "fa.link", "icon": "fa.link",
"align": 0 "align": 2
}, },
"selecttext": { "selecttext": {
"use": true, "use": true,
@ -655,7 +655,7 @@
"texthook" "texthook"
], ],
"icon": "fa.tasks", "icon": "fa.tasks",
"align": 0 "align": 2
}, },
"selectocrrange": { "selectocrrange": {
"use": true, "use": true,
@ -664,7 +664,7 @@
"ocr" "ocr"
], ],
"icon": "fa.crop", "icon": "fa.crop",
"align": 0 "align": 2
}, },
"ocr_once": { "ocr_once": {
"use": false, "use": false,
@ -679,7 +679,7 @@
"ocr" "ocr"
], ],
"icon": "fa.square", "icon": "fa.square",
"align": 0 "align": 2
}, },
"fix": { "fix": {
"use": false, "use": false,
@ -706,7 +706,7 @@
"align": 1 "align": 1
}, },
"move": { "move": {
"use": false, "use": true,
"tip": "移动", "tip": "移动",
"icon": "fa.hand-paper-o", "icon": "fa.hand-paper-o",
"align": 0 "align": 0
@ -716,7 +716,7 @@
"tip": "缩放/恢复游戏窗口", "tip": "缩放/恢复游戏窗口",
"icon": "fa.compress", "icon": "fa.compress",
"icon2": "fa.expand", "icon2": "fa.expand",
"align": 0 "align": 2
}, },
"grabwindow": { "grabwindow": {
"use": false, "use": false,
@ -736,31 +736,31 @@
"tip": "显示/隐藏原文", "tip": "显示/隐藏原文",
"icon": "fa.eye", "icon": "fa.eye",
"icon2": "fa.eye-slash", "icon2": "fa.eye-slash",
"align": 0 "align": 2
}, },
"langdu": { "langdu": {
"use": true, "use": true,
"tip": "朗读", "tip": "朗读",
"icon": "fa.music", "icon": "fa.music",
"align": 0 "align": 2
}, },
"copy": { "copy": {
"use": true, "use": true,
"tip": "复制到剪贴板", "tip": "复制到剪贴板",
"icon": "fa.copy", "icon": "fa.copy",
"align": 0 "align": 2
}, },
"history": { "history": {
"use": true, "use": true,
"tip": "显示/隐藏历史翻译", "tip": "显示/隐藏历史翻译",
"icon": "fa.rotate-left", "icon": "fa.rotate-left",
"align": 0 "align": 2
}, },
"gamepad_new": { "gamepad_new": {
"use": true, "use": true,
"tip": "游戏管理", "tip": "游戏管理",
"icon": "fa.gamepad", "icon": "fa.gamepad",
"align": 0 "align": 2
}, },
"edit": { "edit": {
"use": false, "use": false,
@ -796,13 +796,13 @@
"use": true, "use": true,
"tip": "绑定窗口(部分软件不支持)(点击自己取消)", "tip": "绑定窗口(部分软件不支持)(点击自己取消)",
"icon": "fa.windows", "icon": "fa.windows",
"align": 0 "align": 2
}, },
"keepontop": { "keepontop": {
"use": true, "use": true,
"tip": "窗口置顶", "tip": "窗口置顶",
"icon": "fa.neuter", "icon": "fa.neuter",
"align": 0 "align": 2
}, },
"selectable": { "selectable": {
"use": false, "use": false,
@ -1359,7 +1359,7 @@
}, },
"darklight2": 0, "darklight2": 0,
"darktheme": 0, "darktheme": 0,
"lighttheme": 0, "lighttheme": 1,
"usesearchword": false, "usesearchword": false,
"usecopyword": false, "usecopyword": false,
"usewordorigin": false, "usewordorigin": false,