mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
fix
This commit is contained in:
parent
de8c104672
commit
620f4e84fd
@ -132,6 +132,7 @@ class TextBrowser(QWidget, dataget):
|
|||||||
self.saveiterclasspointer = {}
|
self.saveiterclasspointer = {}
|
||||||
self.extra_height = 0
|
self.extra_height = 0
|
||||||
self.trace = []
|
self.trace = []
|
||||||
|
self.cleared = True
|
||||||
self.resets1()
|
self.resets1()
|
||||||
|
|
||||||
def resets1(self):
|
def resets1(self):
|
||||||
@ -262,6 +263,7 @@ class TextBrowser(QWidget, dataget):
|
|||||||
text,
|
text,
|
||||||
self._createqfont(origin),
|
self._createqfont(origin),
|
||||||
)
|
)
|
||||||
|
self.cleared = False
|
||||||
|
|
||||||
def append(self, origin, atcenter, text, tag, flags, color):
|
def append(self, origin, atcenter, text, tag, flags, color):
|
||||||
self.trace.append(
|
self.trace.append(
|
||||||
@ -281,6 +283,7 @@ class TextBrowser(QWidget, dataget):
|
|||||||
self._textbrowser_append(origin, atcenter, text, tagshow, color)
|
self._textbrowser_append(origin, atcenter, text, tagshow, color)
|
||||||
if len(tag) and (isshow_fenci or isfenciclick):
|
if len(tag) and (isshow_fenci or isfenciclick):
|
||||||
self.addsearchwordmask(isshow_fenci, isfenciclick, tag)
|
self.addsearchwordmask(isshow_fenci, isfenciclick, tag)
|
||||||
|
self.cleared = False
|
||||||
|
|
||||||
def _getqalignment(self, atcenter):
|
def _getqalignment(self, atcenter):
|
||||||
return Qt.AlignmentFlag.AlignCenter if atcenter else Qt.AlignmentFlag.AlignLeft
|
return Qt.AlignmentFlag.AlignCenter if atcenter else Qt.AlignmentFlag.AlignLeft
|
||||||
@ -288,12 +291,11 @@ class TextBrowser(QWidget, dataget):
|
|||||||
def _textbrowser_append(self, origin, atcenter, text: str, tag: list, color):
|
def _textbrowser_append(self, origin, atcenter, text: str, tag: list, color):
|
||||||
self.textbrowser.document().blockSignals(True)
|
self.textbrowser.document().blockSignals(True)
|
||||||
font = self._createqfont(origin)
|
font = self._createqfont(origin)
|
||||||
cleared = len(self.textbrowser.toPlainText()) == 0
|
self._setnextfont(font, self.cleared)
|
||||||
self._setnextfont(font, cleared)
|
|
||||||
self.textbrowser.setAlignment(self._getqalignment(atcenter))
|
self.textbrowser.setAlignment(self._getqalignment(atcenter))
|
||||||
|
|
||||||
_space = "" if cleared else "\n"
|
_space = "" if self.cleared else "\n"
|
||||||
blockcount = 0 if cleared else self.textbrowser.document().blockCount()
|
blockcount = 0 if self.cleared else self.textbrowser.document().blockCount()
|
||||||
hastag = len(tag) > 0
|
hastag = len(tag) > 0
|
||||||
self.textbrowser.insertPlainText(_space + text)
|
self.textbrowser.insertPlainText(_space + text)
|
||||||
blockcount_after = self.textbrowser.document().blockCount()
|
blockcount_after = self.textbrowser.document().blockCount()
|
||||||
@ -754,6 +756,7 @@ class TextBrowser(QWidget, dataget):
|
|||||||
self.resets()
|
self.resets()
|
||||||
self.yinyingposline = 0
|
self.yinyingposline = 0
|
||||||
self.textbrowser.clear()
|
self.textbrowser.clear()
|
||||||
|
self.cleared = True
|
||||||
self.saveiterclasspointer.clear()
|
self.saveiterclasspointer.clear()
|
||||||
self.textbrowser.move(0, 0)
|
self.textbrowser.move(0, 0)
|
||||||
self.atback_color.move(0, 0)
|
self.atback_color.move(0, 0)
|
||||||
|
@ -29,7 +29,7 @@ include(generate_product_version)
|
|||||||
|
|
||||||
set(VERSION_MAJOR 5)
|
set(VERSION_MAJOR 5)
|
||||||
set(VERSION_MINOR 35)
|
set(VERSION_MINOR 35)
|
||||||
set(VERSION_PATCH 8)
|
set(VERSION_PATCH 9)
|
||||||
|
|
||||||
add_library(pch pch.cpp)
|
add_library(pch pch.cpp)
|
||||||
target_precompile_headers(pch PUBLIC pch.h)
|
target_precompile_headers(pch PUBLIC pch.h)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user