mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
fix
This commit is contained in:
parent
bdf5c973aa
commit
b1bd2e5fb3
@ -235,19 +235,17 @@ class MAINUI:
|
|||||||
self.currentread = text
|
self.currentread = text
|
||||||
self.autoreadcheckname()
|
self.autoreadcheckname()
|
||||||
|
|
||||||
|
self.transhis.getnewsentencesignal.emit(text)
|
||||||
|
self.maybesetedittext(text)
|
||||||
|
_showrawfunction = functools.partial(
|
||||||
|
self.translation_ui.displayraw1.emit,
|
||||||
|
dict(text=text, color=globalconfig["rawtextcolor"], onlytrans=onlytrans),
|
||||||
|
)
|
||||||
if globalconfig["refresh_on_get_trans"] == False:
|
if globalconfig["refresh_on_get_trans"] == False:
|
||||||
self.translation_ui.displayraw1.emit(
|
_showrawfunction()
|
||||||
dict(text=text, color=globalconfig["rawtextcolor"], onlytrans=onlytrans)
|
|
||||||
)
|
|
||||||
_showrawfunction = None
|
_showrawfunction = None
|
||||||
_showrawfunction_sig = 0
|
_showrawfunction_sig = 0
|
||||||
else:
|
else:
|
||||||
_showrawfunction = functools.partial(
|
|
||||||
self.translation_ui.displayraw1.emit,
|
|
||||||
dict(
|
|
||||||
text=text, color=globalconfig["rawtextcolor"], onlytrans=onlytrans
|
|
||||||
),
|
|
||||||
)
|
|
||||||
_showrawfunction_sig = time.time()
|
_showrawfunction_sig = time.time()
|
||||||
|
|
||||||
text_solved, optimization_params = self.solvebeforetrans(text)
|
text_solved, optimization_params = self.solvebeforetrans(text)
|
||||||
@ -329,6 +327,7 @@ class MAINUI:
|
|||||||
)
|
)
|
||||||
if no_available_translator:
|
if no_available_translator:
|
||||||
safe_embedcallback_none()
|
safe_embedcallback_none()
|
||||||
|
_showrawfunction()
|
||||||
|
|
||||||
def ifuse_fix_translate_rank_preprare(self, engine, onlytrans, embedcallback):
|
def ifuse_fix_translate_rank_preprare(self, engine, onlytrans, embedcallback):
|
||||||
if onlytrans:
|
if onlytrans:
|
||||||
|
@ -102,7 +102,6 @@ class QUnFrameWindow(resizableframeless):
|
|||||||
onlytrans = kwargs.get("onlytrans")
|
onlytrans = kwargs.get("onlytrans")
|
||||||
|
|
||||||
clear = True
|
clear = True
|
||||||
gobject.baseobject.transhis.getnewsentencesignal.emit(text)
|
|
||||||
if onlytrans:
|
if onlytrans:
|
||||||
return
|
return
|
||||||
if len(text) > globalconfig["maxoriginlength"]:
|
if len(text) > globalconfig["maxoriginlength"]:
|
||||||
@ -114,8 +113,6 @@ class QUnFrameWindow(resizableframeless):
|
|||||||
else:
|
else:
|
||||||
self.showline(clear=clear)
|
self.showline(clear=clear)
|
||||||
|
|
||||||
gobject.baseobject.maybesetedittext(text)
|
|
||||||
|
|
||||||
def showstatus(self, res, color, clear, origin):
|
def showstatus(self, res, color, clear, origin):
|
||||||
self.showline(clear=clear, text=res, color=color, origin=origin)
|
self.showline(clear=clear, text=res, color=color, origin=origin)
|
||||||
|
|
||||||
|
@ -304,7 +304,6 @@ class TextBrowser(QWidget, dataget):
|
|||||||
subtext.append("")
|
subtext.append("")
|
||||||
subtext[-1] += text[i]
|
subtext[-1] += text[i]
|
||||||
|
|
||||||
thisy0 = 99999
|
|
||||||
collects = []
|
collects = []
|
||||||
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]):
|
||||||
@ -318,8 +317,10 @@ class TextBrowser(QWidget, dataget):
|
|||||||
_.adjustSize()
|
_.adjustSize()
|
||||||
_.move(subpos[i])
|
_.move(subpos[i])
|
||||||
_.show()
|
_.show()
|
||||||
thisy0 = min(thisy0, _.y())
|
self.textcursor.setPosition(pos)
|
||||||
|
self.textbrowser.setTextCursor(self.textcursor)
|
||||||
|
tl1 = self.textbrowser.cursorRect(self.textcursor).topLeft()
|
||||||
|
thisy0 = tl1.y()
|
||||||
for label in self.yinyinglabels:
|
for label in self.yinyinglabels:
|
||||||
if label.isVisible() == False:
|
if label.isVisible() == False:
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user