projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cbf3068
)
fixing weird scrolling behavior when fetching dynamic backlog
author
Marcus Eggenberger
<egs@quassel-irc.org>
Thu, 5 Nov 2009 13:34:27 +0000
(14:34 +0100)
committer
Manuel Nickschas
<sputnick@quassel-irc.org>
Thu, 5 Nov 2009 14:19:56 +0000
(15:19 +0100)
src/qtui/chatscene.cpp
patch
|
blob
|
history
diff --git
a/src/qtui/chatscene.cpp
b/src/qtui/chatscene.cpp
index
86a461b
..
af50281
100644
(file)
--- a/
src/qtui/chatscene.cpp
+++ b/
src/qtui/chatscene.cpp
@@
-230,25
+230,11
@@
void ChatScene::rowsInserted(const QModelIndex &index, int start, int end) {
}
// neither pre- or append means we have to do dirty work: move items...
}
// neither pre- or append means we have to do dirty work: move items...
- int moveStart = 0;
- int moveEnd = _lines.count() - 1;
- qreal offset = h;
if(!(atTop || atBottom)) {
if(!(atTop || atBottom)) {
- // move top means: moving 0 to end (aka: end + 1)
- // move top means: moving end + 1 to _lines.count() - 1 (aka: _lines.count() - (end + 1)
- if(end + 1 < _lines.count() - end - 1) {
- // move top part
- moveTop = true;
- offset = -offset;
- moveEnd = end;
- } else {
- // move bottom part
- moveStart = end + 1;
- }
ChatLine *line = 0;
ChatLine *line = 0;
- for(int i =
moveStart; i <= moveE
nd; i++) {
+ for(int i =
0; i <= e
nd; i++) {
line = _lines.at(i);
line = _lines.at(i);
- line->setPos(0, line->pos().y()
+ offset
);
+ line->setPos(0, line->pos().y()
- h
);
}
}
}
}
@@
-285,7
+271,7
@@
void ChatScene::rowsInserted(const QModelIndex &index, int start, int end) {
_firstLineRow = -1;
}
updateSceneRect();
_firstLineRow = -1;
}
updateSceneRect();
- if(atBottom
|| (!atTop && !moveTop)
) {
+ if(atBottom) {
emit lastLineChanged(_lines.last(), h);
}
}
emit lastLineChanged(_lines.last(), h);
}
}
@@
-858,6
+844,7
@@
void ChatScene::updateSceneRect(qreal width) {
ChatLine *firstLine = _lines.at(_firstLineRow);
ChatLine *lastLine = _lines.last();
updateSceneRect(QRectF(0, firstLine->pos().y(), width, lastLine->pos().y() + lastLine->height() - firstLine->pos().y()));
ChatLine *firstLine = _lines.at(_firstLineRow);
ChatLine *lastLine = _lines.last();
updateSceneRect(QRectF(0, firstLine->pos().y(), width, lastLine->pos().y() + lastLine->height() - firstLine->pos().y()));
+ qDebug() << idString() << "top:" << sceneRect().y() << "height:" << sceneRect().height();
} else {
// empty scene rect
updateSceneRect(QRectF(0, 0, width, 0));
} else {
// empty scene rect
updateSceneRect(QRectF(0, 0, width, 0));