This commit is contained in:
恍兮惚兮 2024-08-31 15:05:53 +08:00
parent 5cf2dca235
commit 798de413bd
3 changed files with 10 additions and 5 deletions

View File

@ -306,7 +306,7 @@ class TranslatorWindow(resizableframeless):
color = kwargs.get("color") color = kwargs.get("color")
res = kwargs.get("res") res = kwargs.get("res")
onlytrans = kwargs.get("onlytrans", False) # 仅翻译,不显示 onlytrans = kwargs.get("onlytrans", False) # 仅翻译,不显示
iter_context = kwargs.get("iter_context", (0, None)) iter_context = kwargs.get("iter_context", None)
clear = kwargs.get("clear", False) clear = kwargs.get("clear", False)
iter_res_status, iter_context_class = iter_context iter_res_status, iter_context_class = iter_context
@ -384,7 +384,10 @@ class TranslatorWindow(resizableframeless):
atcenter = globalconfig["showatcenter"] atcenter = globalconfig["showatcenter"]
if iter_context: if iter_context:
_, iter_context_class = iter_context iter_res_status, iter_context_class = iter_context
else:
iter_res_status = 0
if iter_res_status:
self.translate_text.iter_append( self.translate_text.iter_append(
iter_context_class, origin, atcenter, text, color iter_context_class, origin, atcenter, text, color
) )

View File

@ -457,11 +457,13 @@ class TextBrowser(QWidget, dataget):
self.textcursor.setPosition(posx) self.textcursor.setPosition(posx)
posx += 1 posx += 1
tl1 = self.textbrowser.cursorRect(self.textcursor).topLeft() tl1 = self.textbrowser.cursorRect(self.textcursor).topLeft()
if lastpos is None or tl1.y() != lastpos.y() or text[i] == "\n": if lastpos is None or tl1.y() != lastpos.y():
lastpos = tl1 lastpos = tl1
subpos.append(lastpos) subpos.append(lastpos)
subtext.append("") subtext.append("")
subtext[-1] += text[i]
if text[i] != "\n":
subtext[-1] += text[i]
collects = [] collects = []
for i in range(len(subtext)): for i in range(len(subtext)):

View File

@ -29,7 +29,7 @@ include(generate_product_version)
set(VERSION_MAJOR 5) set(VERSION_MAJOR 5)
set(VERSION_MINOR 32) set(VERSION_MINOR 32)
set(VERSION_PATCH 2) set(VERSION_PATCH 3)
add_library(pch pch.cpp) add_library(pch pch.cpp)
target_precompile_headers(pch PUBLIC pch.h) target_precompile_headers(pch PUBLIC pch.h)