1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactoring

This commit is contained in:
krepa098 2015-01-14 20:13:41 +01:00
parent 13746f5c38
commit 3478a5c794
2 changed files with 5 additions and 17 deletions

View File

@ -188,7 +188,7 @@ qreal ChatLog::layout(int start, int end, qreal width)
return deltaY;
}
void ChatLog::partialUpdate()
void ChatLog::updateVisibleLines()
{
checkVisibility();
@ -226,12 +226,6 @@ void ChatLog::partialUpdate()
scrollToBottom();
}
void ChatLog::fullUpdate()
{
layout(0, lines.size(), useableWidth());
checkVisibility();
}
void ChatLog::mousePressEvent(QMouseEvent* ev)
{
QGraphicsView::mousePressEvent(ev);
@ -657,7 +651,7 @@ void ChatLog::checkVisibility()
void ChatLog::scrollContentsBy(int dx, int dy)
{
QGraphicsView::scrollContentsBy(dx, dy);
partialUpdate();
updateVisibleLines();
}
void ChatLog::resizeEvent(QResizeEvent* ev)
@ -673,16 +667,11 @@ void ChatLog::resizeEvent(QResizeEvent* ev)
bool stb = stickToBottom();
QGraphicsView::resizeEvent(ev);
if(lines.count() > 300)
partialUpdate();
else
fullUpdate();
updateVisibleLines();
updateMultiSelectionRect();
if(stb)
scrollToBottom();
updateMultiSelectionRect();
}
void ChatLog::updateMultiSelectionRect()

View File

@ -65,8 +65,7 @@ protected:
void reposition(int start, int end, qreal deltaY);
void updateSceneRect();
void partialUpdate();
void fullUpdate();
void updateVisibleLines();
void checkVisibility();
void scrollToBottom();