Added buddy stars to chat

This commit is contained in:
Matt Lowe 2015-01-23 02:09:01 +01:00
parent b06b81895b
commit d5c8f45ab9
5 changed files with 85 additions and 0 deletions

View file

@ -133,6 +133,9 @@ void ChatView::appendMessage(QString message, QString sender, UserLevelFlags use
if (!sender.isEmpty()) {
const int pixelSize = QFontInfo(cursor.charFormat().font()).pixelSize();
cursor.insertImage(UserLevelPixmapGenerator::generatePixmap(pixelSize, userLevel).toImage(), QString::number(pixelSize) + "_" + QString::number((int) userLevel));
QMap<QString, UserListTWI *> buddyList = tabSupervisor->getUserListsTab()->getBuddyList()->getUsers();
if (buddyList.contains(sender))
cursor.insertImage(PixmapGenerator::generatePixmap(pixelSize, ":/resources/buddy_icon.svg").toImage());
cursor.insertText(" ");
}
cursor.setCharFormat(senderFormat);