mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Green kick msg
This commit is contained in:
parent
9edacd7b3e
commit
29aecc4eb8
3 changed files with 10 additions and 4 deletions
|
|
@ -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("<font color=" + SERVER_MESSAGE_COLOR + ">" + html + "</font>");
|
||||
|
||||
QString htmlText = "<font color=" + ((optionalFontColor.size() > 0) ? optionalFontColor : SERVER_MESSAGE_COLOR) + ">" + html + "</font>";
|
||||
|
||||
if (optionalIsBold)
|
||||
htmlText = "<b>" + htmlText + "</b>";
|
||||
|
||||
prepareBlock().insertHtml(htmlText);
|
||||
if (atBottom)
|
||||
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue