fix for reader flashing

This commit is contained in:
Szybet 2022-09-13 17:42:54 +02:00 committed by Nicolas Mailloux
parent 3a76f2e66c
commit 08db998667

View file

@ -1309,6 +1309,9 @@ void reader::setTextProperties(int alignment, int lineSpacing, int margins, QStr
QTextCursor cursor = ui->text->textCursor(); QTextCursor cursor = ui->text->textCursor();
textDialogLock = true; textDialogLock = true;
// Kudos to Qt for not implementing the opposite of the following function /)_-) // Kudos to Qt for not implementing the opposite of the following function /)_-)
ui->text->setStyleSheet("QTextEdit { selection-background-color: white }");
ui->text->selectAll(); ui->text->selectAll();
if(alignment == 0) { if(alignment == 0) {
ui->text->setAlignment(Qt::AlignLeft); ui->text->setAlignment(Qt::AlignLeft);
@ -1428,6 +1431,7 @@ void reader::setTextProperties(int alignment, int lineSpacing, int margins, QStr
keyCount++; keyCount++;
} }
htmlText.replace(QRegExp("font-family:'.*';"), ""); htmlText.replace(QRegExp("font-family:'.*';"), "");
ui->text->setStyleSheet("QTextEdit { selection-background-color: black }");
ui->text->setHtml(htmlText); ui->text->setHtml(htmlText);
} }