From a09b08f9b09896038fef28e59f0f8c7be2fbbe6e Mon Sep 17 00:00:00 2001 From: fourtf Date: Wed, 1 Feb 2017 16:28:28 +0100 Subject: [PATCH] fixed scrollbars --- widgets/chatwidgetview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/widgets/chatwidgetview.cpp b/widgets/chatwidgetview.cpp index 762ab537..74c6b675 100644 --- a/widgets/chatwidgetview.cpp +++ b/widgets/chatwidgetview.cpp @@ -7,6 +7,7 @@ #include "widgets/chatwidget.h" #include +#include #include #include @@ -61,14 +62,16 @@ ChatWidgetView::layoutMessages() message->layout(this->width(), true); + qDebug() << message->getHeight(); h -= message->getHeight(); if (h < 0) { - this->scrollbar.setLargeChange((messages.length() - i) + + this->scrollbar.setLargeChange((messages.size() - i) + (qreal)h / message->getHeight()); this->scrollbar.setValue(this->scrollbar.getValue()); showScrollbar = true; + break; } }