Basic implementation of indicators.
[quassel.git] / src / qtui / chatview.cpp
index 2a999ea..4c3994f 100644 (file)
@@ -28,7 +28,9 @@
 #include "chatview.h"
 #include "client.h"
 #include "messagefilter.h"
-#include "quasselui.h"
+#include "qtui.h"
+#include "qtuistyle.h"
+#include "clientignorelistmanager.h"
 
 ChatView::ChatView(BufferId bufferId, QWidget *parent)
   : QGraphicsView(parent),
@@ -72,6 +74,10 @@ void ChatView::init(MessageFilter *filter) {
   setScene(_scene);
 
   connect(verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(verticalScrollbarChanged(int)));
+
+  // only connect if client is synched with a core
+  if(Client::isSynced())
+    connect(Client::ignoreListManager(), SIGNAL(ignoreListChanged()), filter, SLOT(invalidateFilter()));
 }
 
 bool ChatView::event(QEvent *event) {
@@ -164,6 +170,10 @@ 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());
 }
 
 MsgId ChatView::lastMsgId() const {