summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-01-14 12:54:17 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-01-14 12:54:17 +0200
commitc4fa8c844d7e4968691cf9260a155e76759d0563 (patch)
treee2c614e7b11314ef231882007be17c7618e56b66 /src
parentMove timestamps to the right (diff)
downloadnheko-c4fa8c844d7e4968691cf9260a155e76759d0563.tar.xz
Add a checkmark to messages that have been received by the server (#93)
Diffstat (limited to 'src')
-rw-r--r--src/timeline/TimelineItem.cc10
-rw-r--r--src/timeline/TimelineView.cc4
2 files changed, 13 insertions, 1 deletions
diff --git a/src/timeline/TimelineItem.cc b/src/timeline/TimelineItem.cc

index a7c73535..d2720600 100644 --- a/src/timeline/TimelineItem.cc +++ b/src/timeline/TimelineItem.cc
@@ -340,6 +340,16 @@ TimelineItem::TimelineItem(const mtx::events::RoomEvent<mtx::events::msg::Text> mainLayout_->addLayout(messageLayout_); } +void +TimelineItem::markReceived() +{ + auto checkmark = new QLabel("✓", this); + checkmark->setStyleSheet(QString("font-size: %1px;").arg(conf::timeline::fonts::timestamp)); + checkmark->setAlignment(Qt::AlignTop); + + messageLayout_->insertWidget(1, checkmark); +} + // Only the body is displayed. void TimelineItem::generateBody(const QString &body) diff --git a/src/timeline/TimelineView.cc b/src/timeline/TimelineView.cc
index 75ce8141..f4cc2d2e 100644 --- a/src/timeline/TimelineView.cc +++ b/src/timeline/TimelineView.cc
@@ -461,8 +461,10 @@ TimelineView::updatePendingMessage(int txn_id, QString event_id) auto msg = pending_msgs_.dequeue(); msg.event_id = event_id; - if (msg.widget) + if (msg.widget) { msg.widget->setEventId(event_id); + msg.widget->markReceived(); + } pending_sent_msgs_.append(msg); }