mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactoring
This commit is contained in:
parent
b4fa8323af
commit
e85ff58223
|
@ -433,25 +433,7 @@ void ChatLog::insertChatlineOnTop(ChatLine::Ptr l)
|
|||
if(!l.get())
|
||||
return;
|
||||
|
||||
bool stickToBtm = stickToBottom();
|
||||
|
||||
//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();
|
||||
insertChatlineOnTop(QList<ChatLine::Ptr>() << l);
|
||||
}
|
||||
|
||||
void ChatLog::insertChatlineOnTop(const QList<ChatLine::Ptr>& newLines)
|
||||
|
|
Loading…
Reference in New Issue
Block a user