Merge pull request #4388: FIX(ui): Make chatwidget max height >= than its minimum height

I can consistently reproduce the linked issue on my machine.
Let me know if you want me to test some other approach.

Fixes #3701.
This commit is contained in:
Robert Adam 2020-08-02 16:02:40 +02:00 committed by GitHub
commit dbb486e5ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,7 +136,9 @@ QSize ChatbarTextEdit::minimumSizeHint() const {
QSize ChatbarTextEdit::sizeHint() const {
QSize sh = QTextEdit::sizeHint();
sh.setHeight(static_cast<qint32>(document()->documentLayout()->documentSize().height()));
const int minHeight = minimumSizeHint().height();
const int documentHeight = document()->documentLayout()->documentSize().height();
sh.setHeight(std::max(minHeight, documentHeight));
const_cast<ChatbarTextEdit *>(this)->setMaximumHeight(sh.height());
return sh;
}