mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
parent
a556762c54
commit
f7018c42c9
|
@ -243,17 +243,17 @@ void Text::regenerate()
|
||||||
{
|
{
|
||||||
doc->setDefaultFont(defFont);
|
doc->setDefaultFont(defFont);
|
||||||
|
|
||||||
if (!elide)
|
if (elide)
|
||||||
{
|
{
|
||||||
doc->setDefaultStyleSheet(defStyleSheet);
|
QFontMetrics metrics = QFontMetrics(defFont);
|
||||||
doc->setHtml(text);
|
QString elidedText = metrics.elidedText(text, Qt::ElideRight, qRound(width));
|
||||||
|
|
||||||
|
doc->setPlainText(elidedText);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QFontMetrics metrics = QFontMetrics(defFont);
|
doc->setDefaultStyleSheet(defStyleSheet);
|
||||||
QString elidedText = metrics.elidedText(rawText, Qt::ElideRight,
|
doc->setHtml(text);
|
||||||
qRound(width));
|
|
||||||
doc->setPlainText(elidedText);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// wrap mode
|
// wrap mode
|
||||||
|
|
Loading…
Reference in New Issue
Block a user