projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Sanitize ChatView's scrolling behavior
[quassel.git]
/
src
/
qtui
/
chatscene.cpp
diff --git
a/src/qtui/chatscene.cpp
b/src/qtui/chatscene.cpp
index
d425555
..
72099e6
100644
(file)
--- a/
src/qtui/chatscene.cpp
+++ b/
src/qtui/chatscene.cpp
@@
-27,7
+27,7
@@
#include "chatscene.h"
#include "quasselui.h"
#include "chatscene.h"
#include "quasselui.h"
-ChatScene::ChatScene(
Message
Model *model, QObject *parent) : QGraphicsScene(parent), _model(model) {
+ChatScene::ChatScene(
QAbstractItem
Model *model, QObject *parent) : QGraphicsScene(parent), _model(model) {
_width = 0;
_timestampWidth = 60;
_senderWidth = 80;
_width = 0;
_timestampWidth = 60;
_senderWidth = 80;
@@
-37,6
+37,7
@@
ChatScene::ChatScene(MessageModel *model, QObject *parent) : QGraphicsScene(pare
_lines.append(line);
addItem(line);
}
_lines.append(line);
addItem(line);
}
+ emit heightChanged(height());
}
ChatScene::~ChatScene() {
}
ChatScene::~ChatScene() {
@@
-67,6
+68,7
@@
void ChatScene::rowsInserted(const QModelIndex &index, int start, int end) {
_lines.value(i)->moveBy(0, h);
}
setSceneRect(QRectF(0, 0, _width, _height));
_lines.value(i)->moveBy(0, h);
}
setSceneRect(QRectF(0, 0, _width, _height));
+ emit heightChanged(height());
}
}
}
}
@@
-77,7
+79,8
@@
void ChatScene::setWidth(int w) {
line->setPos(0, _height);
_height += line->setColumnWidths(_timestampWidth, _senderWidth, w - _timestampWidth - _senderWidth);
}
line->setPos(0, _height);
_height += line->setColumnWidths(_timestampWidth, _senderWidth, w - _timestampWidth - _senderWidth);
}
- setSceneRect(QRectF(0, 0, _width, _height));
+ setSceneRect(QRectF(0, 0, w, _height));
+ emit heightChanged(height());
}
void ChatScene::mousePressEvent ( QGraphicsSceneMouseEvent * mouseEvent ) {
}
void ChatScene::mousePressEvent ( QGraphicsSceneMouseEvent * mouseEvent ) {