summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-07-15 19:18:34 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-07-15 19:18:34 +0300
commit3c1f9696df002b40c30efe754777be489eb7429e (patch)
tree77b60e292938b4b5b95c964d6bc548b308dd67f5 /src
parentUse pixels to specify the font sizes (diff)
downloadnheko-3c1f9696df002b40c30efe754777be489eb7429e.tar.xz
Fix small timestamp misalignment
Diffstat (limited to 'src')
-rw-r--r--src/TimelineItem.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/TimelineItem.cc b/src/TimelineItem.cc

index 7db1c7cf..24b1c90f 100644 --- a/src/TimelineItem.cc +++ b/src/TimelineItem.cc
@@ -330,14 +330,17 @@ void TimelineItem::setupSimpleLayout() QTextEdit htmlText(timestamp_->text()); QString plainText = htmlText.toPlainText(); + timestamp_->adjustSize(); + // Align the end of the avatar bubble with the end of the timestamp for // messages with and without avatar. Otherwise their bodies would not be aligned. - int offset = std::max(0, conf::timeline::avatarSize - timestamp_->fontMetrics().width(plainText)); + int tsWidth = timestamp_->fontMetrics().width(plainText); + int offset = std::max(0, conf::timeline::avatarSize - tsWidth); int defaultFontHeight = QFontMetrics(font_).ascent(); timestamp_->setAlignment(Qt::AlignTop); - timestamp_->setContentsMargins(offset, defaultFontHeight - timestamp_->fontMetrics().ascent(), 0, 0); + timestamp_->setContentsMargins(offset + 1, defaultFontHeight - timestamp_->fontMetrics().ascent(), 0, 0); topLayout_->setContentsMargins(conf::timeline::msgMargin, conf::timeline::msgMargin / 3, 0, 0); }