mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 16:10:40 +02:00
Highlighted the user's own chat messages.
This commit is contained in:
parent
d764ef79ed
commit
5073439007
1 changed files with 13 additions and 8 deletions
|
@ -232,6 +232,11 @@ void ChatWindow::messageReceived(const QXmppMessage& message) {
|
|||
messageLabel->setStyleSheet("padding: 2px; margin-right: 20px");
|
||||
messageLabel->setAlignment(Qt::AlignTop);
|
||||
|
||||
if (getParticipantName(message.from()) == AccountManager::getInstance().getUsername()) {
|
||||
userLabel->setStyleSheet(userLabel->styleSheet() + "; color: palette(highlight)");
|
||||
messageLabel->setStyleSheet(messageLabel->styleSheet() + "; color: palette(highlight)");
|
||||
}
|
||||
|
||||
ui->messagesGridLayout->addWidget(userLabel, ui->messagesGridLayout->rowCount(), 0, Qt::AlignTop | Qt::AlignRight);
|
||||
ui->messagesGridLayout->addWidget(messageLabel, ui->messagesGridLayout->rowCount() - 1, 1);
|
||||
ui->messagesGridLayout->parentWidget()->updateGeometry();
|
||||
|
|
Loading…
Reference in a new issue