summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorChris Tarazi <tarazichris@gmail.com>2018-02-05 20:42:55 -0800
committerChris Tarazi <tarazichris@gmail.com>2018-02-07 21:32:21 -0800
commit2dcc01633ee2eaa84e0643bff42121c8ac50ee80 (patch)
tree4de58e8d6ebe2323fabc4c493ab2658476850939 /src
parentFix #217: create space for checkmark beforehand (diff)
downloadnheko-2dcc01633ee2eaa84e0643bff42121c8ac50ee80.tar.xz
Apply fixed width for checkmark for all messages
Diffstat (limited to 'src')
-rw-r--r--src/timeline/TimelineItem.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/timeline/TimelineItem.cc b/src/timeline/TimelineItem.cc

index db5f19e6..063f1a41 100644 --- a/src/timeline/TimelineItem.cc +++ b/src/timeline/TimelineItem.cc
@@ -30,6 +30,8 @@ #include "timeline/widgets/ImageItem.h" #include "timeline/widgets/VideoItem.h" +constexpr const static char *CHECKMARK = "✓"; + void TimelineItem::init() { @@ -62,7 +64,11 @@ TimelineItem::init() mainLayout_->setContentsMargins(conf::timeline::headerLeftMargin, 0, 0, 0); mainLayout_->setSpacing(0); + // Setting fixed width for checkmark because systems may have a differing width for a + // space and the Unicode checkmark. checkmark_ = new QLabel(" ", this); + checkmark_->setFixedWidth(fm.width(CHECKMARK)); + checkmark_->setFont(font_); checkmark_->setStyleSheet( QString("font-size: %1px;").arg(conf::timeline::fonts::timestamp)); } @@ -351,7 +357,7 @@ TimelineItem::TimelineItem(const mtx::events::RoomEvent<mtx::events::msg::Text> void TimelineItem::markReceived() { - checkmark_->setText("✓"); + checkmark_->setText(CHECKMARK); checkmark_->setAlignment(Qt::AlignTop); }