|
|
@ -433,25 +433,7 @@ void ChatLog::insertChatlineOnTop(ChatLine::Ptr l) |
|
|
|
if(!l.get()) |
|
|
|
if(!l.get()) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
bool stickToBtm = stickToBottom(); |
|
|
|
insertChatlineOnTop(QList<ChatLine::Ptr>() << l); |
|
|
|
|
|
|
|
|
|
|
|
//move all lines down by 1
|
|
|
|
|
|
|
|
for(ChatLine::Ptr l : lines) |
|
|
|
|
|
|
|
l->setRowIndex(l->getRowIndex() + 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//add the new line
|
|
|
|
|
|
|
|
l->addToScene(scene); |
|
|
|
|
|
|
|
l->setRowIndex(0); |
|
|
|
|
|
|
|
lines.prepend(l); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//full refresh is required
|
|
|
|
|
|
|
|
layout(0, lines.size(), useableWidth()); |
|
|
|
|
|
|
|
updateSceneRect(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(stickToBtm) |
|
|
|
|
|
|
|
scrollToBottom(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
checkVisibility(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void ChatLog::insertChatlineOnTop(const QList<ChatLine::Ptr>& newLines) |
|
|
|
void ChatLog::insertChatlineOnTop(const QList<ChatLine::Ptr>& newLines) |
|
|
|