summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-01-14 12:29:54 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-01-14 12:29:54 +0200
commitdfeb0c833ab094969c5da7f1a5953b30b5960665 (patch)
treea7dcda0e2a891139120153306b335dddbaaa6745 /include
parentFix macOs ci (diff)
downloadnheko-dfeb0c833ab094969c5da7f1a5953b30b5960665.tar.xz
Move timestamps to the right
Diffstat (limited to 'include')
-rw-r--r--include/Config.h2
-rw-r--r--include/timeline/TimelineItem.h33
2 files changed, 27 insertions, 8 deletions
diff --git a/include/Config.h b/include/Config.h

index 5492e5fb..6874a2e5 100644 --- a/include/Config.h +++ b/include/Config.h
@@ -83,7 +83,7 @@ static constexpr int headerSpacing = 7; static constexpr int headerLeftMargin = 15; namespace fonts { -static constexpr int timestamp = 10; +static constexpr int timestamp = 13; static constexpr int dateSeparator = conf::fontSize - 2; } // namespace fonts } // namespace timeline diff --git a/include/timeline/TimelineItem.h b/include/timeline/TimelineItem.h
index 9a0aee1d..15cbc714 100644 --- a/include/timeline/TimelineItem.h +++ b/include/timeline/TimelineItem.h
@@ -122,10 +122,14 @@ private: QAction *showReadReceipts_; QHBoxLayout *topLayout_; - QVBoxLayout *sideLayout_; // Avatar or Timestamp - QVBoxLayout *mainLayout_; // Header & Message body + //! The message and the timestamp/checkmark. + QHBoxLayout *messageLayout_; + //! Avatar or Timestamp + QVBoxLayout *sideLayout_; + //! Header & Message body + QVBoxLayout *mainLayout_; - QHBoxLayout *headerLayout_; // Username (&) Timestamp + QVBoxLayout *headerLayout_; // Username (&) Timestamp Avatar *userAvatar_; @@ -159,17 +163,25 @@ TimelineItem::setupLocalWidgetLayout(Widget *widget, widgetLayout->addWidget(widget); widgetLayout->addStretch(1); + messageLayout_->setContentsMargins(0, 0, 20, 4); + messageLayout_->setSpacing(20); + if (withSender) { generateBody(displayName, ""); setupAvatarLayout(displayName); - mainLayout_->addLayout(headerLayout_); + + headerLayout_->addLayout(widgetLayout); + messageLayout_->addLayout(headerLayout_, 1); AvatarProvider::resolve(userid, [=](const QImage &img) { setUserAvatar(img); }); } else { setupSimpleLayout(); + + messageLayout_->addLayout(widgetLayout, 1); } - mainLayout_->addLayout(widgetLayout); + messageLayout_->addWidget(timestamp_); + mainLayout_->addLayout(messageLayout_); } template<class Event, class Widget> @@ -201,16 +213,23 @@ TimelineItem::setupWidgetLayout(Widget *widget, widgetLayout->addWidget(widget); widgetLayout->addStretch(1); + messageLayout_->setContentsMargins(0, 0, 20, 4); + messageLayout_->setSpacing(20); + if (withSender) { generateBody(displayName, ""); setupAvatarLayout(displayName); - mainLayout_->addLayout(headerLayout_); + headerLayout_->addLayout(widgetLayout); + messageLayout_->addLayout(headerLayout_, 1); AvatarProvider::resolve(sender, [=](const QImage &img) { setUserAvatar(img); }); } else { setupSimpleLayout(); + + messageLayout_->addLayout(widgetLayout, 1); } - mainLayout_->addLayout(widgetLayout); + messageLayout_->addWidget(timestamp_); + mainLayout_->addLayout(messageLayout_); }