QTfrontend/chatwidget.cpp
changeset 2396 e13a1117152b
parent 2380 603965eca22b
child 2428 6800f8aa0184
equal deleted inserted replaced
2395:d01d3bf3e1de 2396:e13a1117152b
    76 void HWChatWidget::onChatString(const QString& str)
    76 void HWChatWidget::onChatString(const QString& str)
    77 {
    77 {
    78 	if (chatStrings.size() > 250)
    78 	if (chatStrings.size() > 250)
    79 		chatStrings.removeFirst();
    79 		chatStrings.removeFirst();
    80 
    80 
    81 	QString formattedStr = Qt::escape(str);
    81 	QString formattedStr = Qt::escape(str.mid(1));
    82 	if (formattedStr.startsWith("["))
    82 	if (str.startsWith("\x03"))
    83 		formattedStr = QString("<font color=grey>%1</font>").arg(formattedStr);
    83 		formattedStr = QString("<font color=grey>%1</font>").arg(formattedStr);
       
    84 	else if (str.startsWith("\x02"))
       
    85 		formattedStr = QString("<font color=magenta>%1</font>").arg(formattedStr);
       
    86 
    84 
    87 
    85 	chatStrings.append(formattedStr);
    88 	chatStrings.append(formattedStr);
    86 
    89 
    87 	chatText->setHtml(chatStrings.join("<br>"));
    90 	chatText->setHtml(chatStrings.join("<br>"));
    88 
    91