Use QFontMetrics::elidedText over manual implementation (#4807)

This commit is contained in:
nerix
2023-09-09 14:09:25 +02:00
committed by GitHub
parent d4558b5fe5
commit 515c40f857
4 changed files with 17 additions and 36 deletions
@@ -424,11 +424,16 @@ bool MessageLayoutContainer::atStartOfLine()
bool MessageLayoutContainer::fitsInLine(int _width)
{
return this->currentX_ + _width <=
(this->width_ - int(this->margin.left * this->scale_) -
return _width <= this->remainingWidth();
}
int MessageLayoutContainer::remainingWidth() const
{
return (this->width_ - int(this->margin.left * this->scale_) -
int(this->margin.right * this->scale_) -
(this->line_ + 1 == MAX_UNCOLLAPSED_LINES ? this->dotdotdotWidth_
: 0));
: 0)) -
this->currentX_;
}
void MessageLayoutContainer::end()