mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
Update textbrowser.py
This commit is contained in:
parent
0e61a1fbc5
commit
093d655a3d
@ -393,12 +393,12 @@ class Textbrowser:
|
|||||||
|
|
||||||
index = linei
|
index = linei
|
||||||
_ = self.yinyinglabels[index]
|
_ = self.yinyinglabels[index]
|
||||||
if self.align:#不然有时候有一个微小的错位
|
if self.align:
|
||||||
fm = QFontMetricsF(self.textbrowser.currentCharFormat().font())
|
_.setAlignment(Qt.AlignCenter)
|
||||||
w = fm.width(block.text()[s : s + l])
|
_.move(0,tl1.y())
|
||||||
WW = self.textbrowser.width()
|
_.setFixedWidth(self.textbrowser.width())
|
||||||
_.move(int(WW / 2 - w / 2), tl1.y())
|
|
||||||
else:
|
else:
|
||||||
|
_.setAlignment(Qt.AlignLeft)
|
||||||
_.move(tl1)
|
_.move(tl1)
|
||||||
_.setText(block.text()[s : s + l])
|
_.setText(block.text()[s : s + l])
|
||||||
_.setFont(self.textbrowser.currentCharFormat().font())
|
_.setFont(self.textbrowser.currentCharFormat().font())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user