Make ChatView's scrollbar behavior a bit more tolerant to workaround BR 238 for now
authorManuel Nickschas <sputnick@quassel-irc.org>
Sun, 3 Aug 2008 22:46:02 +0000 (00:46 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 3 Aug 2008 22:46:02 +0000 (00:46 +0200)
src/qtui/chatscene.h
src/qtui/chatview.cpp

index 70605cc..cd71aac 100644 (file)
@@ -42,6 +42,7 @@ class ChatScene : public QGraphicsScene {
 
     Buffer *buffer() const;
     inline QAbstractItemModel *model() const { return _model; }
+    inline QString idString() const { return _idString; }
 
   public slots:
     void setWidth(qreal);
index ffd9e72..98346ca 100644 (file)
@@ -67,7 +67,7 @@ void ChatView::resizeEvent(QResizeEvent *event) {
 
 void ChatView::sceneHeightChanged(qreal h) {
   Q_UNUSED(h)
-  bool scrollable = verticalScrollBar()->value() == verticalScrollBar()->maximum();
+  bool scrollable = qAbs(verticalScrollBar()->value() - verticalScrollBar()->maximum()) <= 2; // be a bit tolerant here, also FIXME (why we need this?)
   setSceneRect(scene()->sceneRect());
   if(scrollable) verticalScrollBar()->setValue(verticalScrollBar()->maximum());
 }