projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d77cc96
)
fixing wrong positioning of items (fixes overlapping daychange bug)
author
Marcus Eggenberger
<egs@quassel-irc.org>
Sat, 4 Oct 2008 11:14:56 +0000
(13:14 +0200)
committer
Marcus Eggenberger
<egs@quassel-irc.org>
Sat, 4 Oct 2008 11:14:56 +0000
(13:14 +0200)
src/qtui/chatscene.cpp
patch
|
blob
|
history
diff --git
a/src/qtui/chatscene.cpp
b/src/qtui/chatscene.cpp
index
b5dd452
..
4734d9c
100644
(file)
--- a/
src/qtui/chatscene.cpp
+++ b/
src/qtui/chatscene.cpp
@@
-122,20
+122,28
@@
void ChatScene::rowsInserted(const QModelIndex &index, int start, int end) {
QPointF contentsPos(secondColumnHandle()->sceneRight(), 0);
QPointF senderPos(firstColumnHandle()->sceneRight(), 0);
QPointF contentsPos(secondColumnHandle()->sceneRight(), 0);
QPointF senderPos(firstColumnHandle()->sceneRight(), 0);
-
for(int i = start; i <= end; i++
) {
- ChatLine *line = new ChatLine(i, model(),
-
width
,
-
timestampWidth, senderWidth, contentsW
idth,
- senderPos, contentsPos);
- if(atTop) {
+
if(atTop
) {
+ for(int i = end; i >= start; i--) {
+
ChatLine *line = new ChatLine(i, model()
,
+
w
idth,
+ timestampWidth, senderWidth, contentsWidth,
+ senderPos, contentsPos);
h += line->height();
line->setPos(0, y-h);
h += line->height();
line->setPos(0, y-h);
- } else {
+ _lines.insert(start, line);
+ addItem(line);
+ }
+ } else {
+ for(int i = start; i <= end; i++) {
+ ChatLine *line = new ChatLine(i, model(),
+ width,
+ timestampWidth, senderWidth, contentsWidth,
+ senderPos, contentsPos);
line->setPos(0, y+h);
h += line->height();
line->setPos(0, y+h);
h += line->height();
+ _lines.insert(i, line);
+ addItem(line);
}
}
- _lines.insert(i, line);
- addItem(line);
}
// update existing items
}
// update existing items
@@
-166,7
+174,7
@@
void ChatScene::rowsInserted(const QModelIndex &index, int start, int end) {
moveEnd = end;
} else {
// move bottom part
moveEnd = end;
} else {
// move bottom part
- moveStart =
start
;
+ moveStart =
end + 1
;
}
ChatLine *line = 0;
for(int i = moveStart; i <= moveEnd; i++) {
}
ChatLine *line = 0;
for(int i = moveStart; i <= moveEnd; i++) {