mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
server version bump, minor chat view fix
This commit is contained in:
parent
d4f600393f
commit
713ebece78
3 changed files with 6 additions and 5 deletions
|
|
@ -10,7 +10,7 @@ ChatView::ChatView(const QString &_ownName, QWidget *parent)
|
|||
setTextInteractionFlags(Qt::TextSelectableByMouse);
|
||||
}
|
||||
|
||||
void ChatView::appendMessage(const QString &sender, const QString &message)
|
||||
void ChatView::appendMessage(QString sender, const QString &message)
|
||||
{
|
||||
QTextCursor cursor(document()->lastBlock());
|
||||
cursor.movePosition(QTextCursor::End);
|
||||
|
|
@ -31,7 +31,9 @@ void ChatView::appendMessage(const QString &sender, const QString &message)
|
|||
} else
|
||||
senderFormat.setForeground(Qt::blue);
|
||||
cursor.setCharFormat(senderFormat);
|
||||
cursor.insertText(sender + " ");
|
||||
if (!sender.isEmpty())
|
||||
sender.append(" ");
|
||||
cursor.insertText(sender);
|
||||
|
||||
QTextCharFormat messageFormat;
|
||||
if (sender.isEmpty())
|
||||
|
|
@ -39,6 +41,5 @@ void ChatView::appendMessage(const QString &sender, const QString &message)
|
|||
cursor.setCharFormat(messageFormat);
|
||||
cursor.insertText(message);
|
||||
|
||||
|
||||
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue