QTfrontend/chatwidget.cpp
changeset 1626 58fd5bc49a04
parent 1589 53eb1d3953ef
child 1666 b66e014510e7
equal deleted inserted replaced
1625:37aae47943ce 1626:58fd5bc49a04
    73 
    73 
    74 void HWChatWidget::onChatString(const QString& str)
    74 void HWChatWidget::onChatString(const QString& str)
    75 {
    75 {
    76 	if (chatStrings.size() > 250)
    76 	if (chatStrings.size() > 250)
    77 		chatStrings.removeFirst();
    77 		chatStrings.removeFirst();
       
    78 
       
    79 	QString formattedStr = Qt::escape(str);
       
    80 	if (formattedStr.startsWith("***"))
       
    81 		formattedStr = QString("<font color=grey>%1</font>").arg(formattedStr);
    78 	
    82 	
    79 	chatStrings.append(Qt::escape(str));
    83 	chatStrings.append(formattedStr);
    80 	
    84 	
    81 	chatText->setHtml(chatStrings.join("<br>"));
    85 	chatText->setHtml(chatStrings.join("<br>"));
    82 
    86 
    83 	chatText->moveCursor(QTextCursor::End);
    87 	chatText->moveCursor(QTextCursor::End);
    84 }
    88 }