+void ChatView::resizeEvent(QResizeEvent *event) {
+ scene()->setWidth(event->size().width() - 2); // FIXME figure out why we have to hardcode the -2 here
+ verticalScrollBar()->setValue(verticalScrollBar()->maximum());
+}
+
+void ChatView::sceneHeightChanged(qreal h) {
+ Q_UNUSED(h)
+ bool scrollable = verticalScrollBar()->value() == verticalScrollBar()->maximum();
+ setSceneRect(scene()->sceneRect());
+ if(scrollable) verticalScrollBar()->setValue(verticalScrollBar()->maximum());
+}