mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-14 08:54:34 +12:00
Small bug
This commit is contained in:
parent
ef1ba855e7
commit
ed0bfed8dc
|
@ -29,7 +29,9 @@ class basicHighlighter(QSyntaxHighlighter):
|
||||||
"""Apply syntax highlighting to the given block of text.
|
"""Apply syntax highlighting to the given block of text.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
QTextCursor(self.currentBlock()).setBlockFormat(self._defaultBlockFormat)
|
bf = QTextBlockFormat(self._defaultBlockFormat)
|
||||||
|
bf.setAlignment(QTextCursor(self.currentBlock()).blockFormat().alignment())
|
||||||
|
QTextCursor(self.currentBlock()).setBlockFormat(bf)
|
||||||
#self.setFormat(0, len(text), self._defaultCharFormat)
|
#self.setFormat(0, len(text), self._defaultCharFormat)
|
||||||
|
|
||||||
# Spell checking
|
# Spell checking
|
||||||
|
|
|
@ -456,15 +456,15 @@ class textEditView(QTextEdit):
|
||||||
|
|
||||||
cursor = self.textCursor()
|
cursor = self.textCursor()
|
||||||
|
|
||||||
bf = cursor.blockFormat()
|
#bf = cursor.blockFormat()
|
||||||
|
bf = QTextBlockFormat()
|
||||||
bf.setAlignment(
|
bf.setAlignment(
|
||||||
Qt.AlignLeft if _format == "Left" else
|
Qt.AlignLeft if _format == "Left" else
|
||||||
Qt.AlignHCenter if _format == "Center" else
|
Qt.AlignHCenter if _format == "Center" else
|
||||||
Qt.AlignRight if _format == "Right" else
|
Qt.AlignRight if _format == "Right" else
|
||||||
Qt.AlignJustify)
|
Qt.AlignJustify)
|
||||||
print(bf.alignment() == Qt.AlignLeft)
|
|
||||||
|
|
||||||
cursor.mergeBlockFormat(bf)
|
cursor.setBlockFormat(bf)
|
||||||
self.setTextCursor(cursor)
|
self.setTextCursor(cursor)
|
||||||
|
|
||||||
elif self._textFormat == "t2t":
|
elif self._textFormat == "t2t":
|
||||||
|
|
Loading…
Reference in a new issue