Buddy stars

Buddies will now be seen as stars in the chat
This commit is contained in:
Matt Lowe 2015-01-31 17:11:17 +01:00
parent 6d4716b38f
commit d57a6111aa
12 changed files with 409 additions and 12 deletions

View file

@ -4,6 +4,7 @@
#include <QMouseEvent>
#include <QDesktopServices>
#include <QApplication>
#include <QDebug>
#include "chatview.h"
#include "user_level.h"
#include "user_context_menu.h"
@ -130,7 +131,8 @@ void ChatView::appendMessage(QString message, QString sender, UserLevelFlags use
if (!sameSender) {
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();
cursor.insertImage(UserLevelPixmapGenerator::generatePixmap(pixelSize, userLevel, buddyList.contains(sender)).toImage());
cursor.insertText(" ");
}
cursor.setCharFormat(senderFormat);