Browse Source

refactoring

pull/974/head
krepa098 11 years ago
parent
commit
e85ff58223
  1. 20
      src/chatlog/chatlog.cpp

20
src/chatlog/chatlog.cpp

@ -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)

Loading…
Cancel
Save