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