From 88a3a1b3c02b6f7a2a7898f0f95df3473f46df4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Fri, 12 Jul 2024 00:27:55 +0800 Subject: [PATCH] fix --- .../LunaTranslator/rendertext/textbrowser.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/LunaTranslator/LunaTranslator/rendertext/textbrowser.py b/LunaTranslator/LunaTranslator/rendertext/textbrowser.py index 8646dd0a..c1ec7621 100644 --- a/LunaTranslator/LunaTranslator/rendertext/textbrowser.py +++ b/LunaTranslator/LunaTranslator/rendertext/textbrowser.py @@ -168,14 +168,14 @@ class TextBrowser(QWidget, dataget): def _setnextfont(self, font, cleared): if cleared: self.textbrowser.setFont(font) - else: - self.textbrowser.moveCursor(QTextCursor.MoveOperation.End) - f = QTextCharFormat() - f.setFont(font) - f.setForeground(self.tranparentcolor) - c = self.textbrowser.textCursor() - c.setCharFormat(f) - self.textbrowser.setTextCursor(c) + + self.textbrowser.moveCursor(QTextCursor.MoveOperation.End) + f = QTextCharFormat() + f.setFont(font) + f.setForeground(self.tranparentcolor) + c = self.textbrowser.textCursor() + c.setCharFormat(f) + self.textbrowser.setTextCursor(c) def iter_append(self, iter_context_class, origin, atcenter, text, color, cleared): self._textbrowser_iter_append(