X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatview.cpp;h=3c7d8cf9d59ea24d4bc8275a170b54e9a73c73d6;hp=2a999ea19de9c7cf5c7a08a94e75df29f79c43cb;hb=9fb25d34cfc4dee02159b112c72e018c6e26e63f;hpb=86831c8857f0a729580cee547e10c9621d50c780 diff --git a/src/qtui/chatview.cpp b/src/qtui/chatview.cpp index 2a999ea1..3c7d8cf9 100644 --- a/src/qtui/chatview.cpp +++ b/src/qtui/chatview.cpp @@ -28,7 +28,8 @@ #include "chatview.h" #include "client.h" #include "messagefilter.h" -#include "quasselui.h" +#include "qtui.h" +#include "qtuistyle.h" ChatView::ChatView(BufferId bufferId, QWidget *parent) : QGraphicsView(parent), @@ -72,6 +73,7 @@ void ChatView::init(MessageFilter *filter) { setScene(_scene); connect(verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(verticalScrollbarChanged(int))); + connect(QtUi::style(), SIGNAL(changed()), this, SLOT(styleChanged())); } bool ChatView::event(QEvent *event) { @@ -164,6 +166,16 @@ void ChatView::verticalScrollbarChanged(int newPos) { } } _lastScrollbarPos = newPos; + + // FIXME: Fugly workaround for the ChatView scrolling up 1px on buffer switch + if(vbar->maximum() - newPos <= 2) + vbar->setValue(vbar->maximum()); +} + +void ChatView::styleChanged() { + invalidateScene(); + if(scene()) + scene()->update(); } MsgId ChatView::lastMsgId() const {