fixed scrollbars
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
#include "widgets/chatwidget.h"
|
#include "widgets/chatwidget.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <QDebug>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
@@ -61,14 +62,16 @@ ChatWidgetView::layoutMessages()
|
|||||||
|
|
||||||
message->layout(this->width(), true);
|
message->layout(this->width(), true);
|
||||||
|
|
||||||
|
qDebug() << message->getHeight();
|
||||||
h -= message->getHeight();
|
h -= message->getHeight();
|
||||||
|
|
||||||
if (h < 0) {
|
if (h < 0) {
|
||||||
this->scrollbar.setLargeChange((messages.length() - i) +
|
this->scrollbar.setLargeChange((messages.size() - i) +
|
||||||
(qreal)h / message->getHeight());
|
(qreal)h / message->getHeight());
|
||||||
this->scrollbar.setValue(this->scrollbar.getValue());
|
this->scrollbar.setValue(this->scrollbar.getValue());
|
||||||
|
|
||||||
showScrollbar = true;
|
showScrollbar = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user