From 29aecc4eb83db3a9ec931ad252e6ebd62e5d739b Mon Sep 17 00:00:00 2001 From: Zach H Date: Sat, 11 Jul 2015 18:31:24 -0400 Subject: [PATCH] Green kick msg --- cockatrice/src/chatview.cpp | 10 ++++++++-- cockatrice/src/chatview.h | 2 +- cockatrice/src/messagelogwidget.cpp | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cockatrice/src/chatview.cpp b/cockatrice/src/chatview.cpp index 2b967ac4..6af5f104 100644 --- a/cockatrice/src/chatview.cpp +++ b/cockatrice/src/chatview.cpp @@ -73,10 +73,16 @@ void ChatView::appendHtml(const QString &html) verticalScrollBar()->setValue(verticalScrollBar()->maximum()); } -void ChatView::appendHtmlServerMessage(const QString &html) +void ChatView::appendHtmlServerMessage(const QString &html, bool optionalIsBold, QString optionalFontColor) { bool atBottom = verticalScrollBar()->value() >= verticalScrollBar()->maximum(); - prepareBlock().insertHtml("" + html + ""); + + QString htmlText = "" + html + ""; + + if (optionalIsBold) + htmlText = "" + htmlText + ""; + + prepareBlock().insertHtml(htmlText); if (atBottom) verticalScrollBar()->setValue(verticalScrollBar()->maximum()); } diff --git a/cockatrice/src/chatview.h b/cockatrice/src/chatview.h index 17d73d72..ccf28efa 100644 --- a/cockatrice/src/chatview.h +++ b/cockatrice/src/chatview.h @@ -51,7 +51,7 @@ public: ChatView(const TabSupervisor *_tabSupervisor, TabGame *_game, bool _showTimestamps, QWidget *parent = 0); void retranslateUi(); void appendHtml(const QString &html); - void appendHtmlServerMessage(const QString &html); + void appendHtmlServerMessage(const QString &html, bool optionalIsBold = false, QString optionalFontColor = QString()); void appendMessage(QString message, QString sender = QString(), UserLevelFlags userLevel = UserLevelFlags(), bool playerBold = false); void clearChat(); protected: diff --git a/cockatrice/src/messagelogwidget.cpp b/cockatrice/src/messagelogwidget.cpp index cf8e6998..7b76d8b9 100644 --- a/cockatrice/src/messagelogwidget.cpp +++ b/cockatrice/src/messagelogwidget.cpp @@ -76,7 +76,7 @@ void MessageLogWidget::logGameClosed() void MessageLogWidget::logKicked() { - appendHtmlServerMessage(tr("You have been kicked out of the game.")); + appendHtmlServerMessage(tr("You have been kicked out of the game."), true); } void MessageLogWidget::logJoinSpectator(QString name)