mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge pull request #3571
Diadlo (1): fix(text): Using modified text, instead of raw
This commit is contained in:
commit
6296f5de34
|
@ -243,17 +243,17 @@ void Text::regenerate()
|
|||
{
|
||||
doc->setDefaultFont(defFont);
|
||||
|
||||
if (!elide)
|
||||
if (elide)
|
||||
{
|
||||
doc->setDefaultStyleSheet(defStyleSheet);
|
||||
doc->setHtml(text);
|
||||
QFontMetrics metrics = QFontMetrics(defFont);
|
||||
QString elidedText = metrics.elidedText(text, Qt::ElideRight, qRound(width));
|
||||
|
||||
doc->setPlainText(elidedText);
|
||||
}
|
||||
else
|
||||
{
|
||||
QFontMetrics metrics = QFontMetrics(defFont);
|
||||
QString elidedText = metrics.elidedText(rawText, Qt::ElideRight,
|
||||
qRound(width));
|
||||
doc->setPlainText(elidedText);
|
||||
doc->setDefaultStyleSheet(defStyleSheet);
|
||||
doc->setHtml(text);
|
||||
}
|
||||
|
||||
// wrap mode
|
||||
|
|
Loading…
Reference in New Issue
Block a user