mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
fix
This commit is contained in:
parent
e0534fc547
commit
bc47a3791d
@ -450,7 +450,8 @@ class MAINUI:
|
|||||||
)
|
)
|
||||||
if result:
|
if result:
|
||||||
# 预翻译
|
# 预翻译
|
||||||
callback(result, 0)
|
callback(result, 1)
|
||||||
|
callback(result, 2)
|
||||||
else:
|
else:
|
||||||
|
|
||||||
self.translators[engine].gettask(task)
|
self.translators[engine].gettask(task)
|
||||||
|
@ -467,7 +467,11 @@ class TextBrowser(QWidget, dataget):
|
|||||||
def _showyinyingtext2(self, color, iter_context_class, pos, text, font):
|
def _showyinyingtext2(self, color, iter_context_class, pos, text, font):
|
||||||
if iter_context_class not in self.iteryinyinglabelsave:
|
if iter_context_class not in self.iteryinyinglabelsave:
|
||||||
self.iteryinyinglabelsave[iter_context_class] = []
|
self.iteryinyinglabelsave[iter_context_class] = []
|
||||||
|
count = 0
|
||||||
for label in self.iteryinyinglabelsave[iter_context_class]:
|
for label in self.iteryinyinglabelsave[iter_context_class]:
|
||||||
|
if label.isVisible():
|
||||||
|
count += 1
|
||||||
|
else:
|
||||||
label.hide()
|
label.hide()
|
||||||
|
|
||||||
maxh = self.maxvisheight
|
maxh = self.maxvisheight
|
||||||
@ -489,6 +493,7 @@ class TextBrowser(QWidget, dataget):
|
|||||||
if text[i] != "\n":
|
if text[i] != "\n":
|
||||||
subtext[-1] += text[i]
|
subtext[-1] += text[i]
|
||||||
collects = []
|
collects = []
|
||||||
|
needmovenexts = len(subtext) != count
|
||||||
for i in range(len(subtext)):
|
for i in range(len(subtext)):
|
||||||
|
|
||||||
if i >= len(self.iteryinyinglabelsave[iter_context_class]):
|
if i >= len(self.iteryinyinglabelsave[iter_context_class]):
|
||||||
@ -503,7 +508,8 @@ class TextBrowser(QWidget, dataget):
|
|||||||
_.adjustSize()
|
_.adjustSize()
|
||||||
_.move(subpos[i].x(), subpos[i].y() + self.labeloffset_y)
|
_.move(subpos[i].x(), subpos[i].y() + self.labeloffset_y)
|
||||||
_.show()
|
_.show()
|
||||||
|
if not needmovenexts:
|
||||||
|
return
|
||||||
self.textcursor.setPosition(pos)
|
self.textcursor.setPosition(pos)
|
||||||
self.textbrowser.setTextCursor(self.textcursor)
|
self.textbrowser.setTextCursor(self.textcursor)
|
||||||
tl1 = self.textbrowser.cursorRect(self.textcursor).topLeft()
|
tl1 = self.textbrowser.cursorRect(self.textcursor).topLeft()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user