mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
cardInfoPopup fix; chatView fix
This commit is contained in:
parent
9f098f2a6d
commit
0120d2a019
13 changed files with 38 additions and 25 deletions
|
|
@ -15,7 +15,7 @@ ChatView::ChatView(const QString &_ownName, bool _showTimestamps, QWidget *paren
|
|||
connect(this, SIGNAL(anchorClicked(const QUrl &)), this, SLOT(openLink(const QUrl &)));
|
||||
}
|
||||
|
||||
void ChatView::appendMessage(QString sender, QString message)
|
||||
void ChatView::appendMessage(QString sender, QString message, QColor playerColor, bool playerBold)
|
||||
{
|
||||
QTextCursor cursor(document()->lastBlock());
|
||||
cursor.movePosition(QTextCursor::End);
|
||||
|
|
@ -35,8 +35,14 @@ void ChatView::appendMessage(QString sender, QString message)
|
|||
if (sender == ownName) {
|
||||
senderFormat.setFontWeight(QFont::Bold);
|
||||
senderFormat.setForeground(Qt::red);
|
||||
} else
|
||||
senderFormat.setForeground(QColor(0, 0, 254));
|
||||
} else {
|
||||
if (playerColor == QColor())
|
||||
senderFormat.setForeground(QColor(0, 0, 254));
|
||||
else
|
||||
senderFormat.setForeground(playerColor);
|
||||
if (playerBold)
|
||||
senderFormat.setFontWeight(QFont::Bold);
|
||||
}
|
||||
cursor.setCharFormat(senderFormat);
|
||||
if (!sender.isEmpty())
|
||||
sender.append(": ");
|
||||
|
|
@ -156,7 +162,7 @@ void ChatView::mousePressEvent(QMouseEvent *event)
|
|||
void ChatView::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::MidButton)
|
||||
emit deleteCardInfoPopup();
|
||||
emit deleteCardInfoPopup(QString("_"));
|
||||
|
||||
QTextBrowser::mouseReleaseEvent(event);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue