mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
iter
This commit is contained in:
parent
5cf2dca235
commit
798de413bd
@ -306,7 +306,7 @@ class TranslatorWindow(resizableframeless):
|
||||
color = kwargs.get("color")
|
||||
res = kwargs.get("res")
|
||||
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)
|
||||
|
||||
iter_res_status, iter_context_class = iter_context
|
||||
@ -384,7 +384,10 @@ class TranslatorWindow(resizableframeless):
|
||||
atcenter = globalconfig["showatcenter"]
|
||||
|
||||
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(
|
||||
iter_context_class, origin, atcenter, text, color
|
||||
)
|
||||
|
@ -457,11 +457,13 @@ class TextBrowser(QWidget, dataget):
|
||||
self.textcursor.setPosition(posx)
|
||||
posx += 1
|
||||
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
|
||||
subpos.append(lastpos)
|
||||
subtext.append("")
|
||||
subtext[-1] += text[i]
|
||||
|
||||
if text[i] != "\n":
|
||||
subtext[-1] += text[i]
|
||||
|
||||
collects = []
|
||||
for i in range(len(subtext)):
|
||||
|
@ -29,7 +29,7 @@ include(generate_product_version)
|
||||
|
||||
set(VERSION_MAJOR 5)
|
||||
set(VERSION_MINOR 32)
|
||||
set(VERSION_PATCH 2)
|
||||
set(VERSION_PATCH 3)
|
||||
|
||||
add_library(pch pch.cpp)
|
||||
target_precompile_headers(pch PUBLIC pch.h)
|
||||
|
Loading…
x
Reference in New Issue
Block a user