Skip to content

Commit

Permalink
Use a smaller font size for the timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
mujx committed Oct 7, 2018
1 parent f272d92 commit 184c8b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/RoomInfoListItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ RoomInfoListItem::paintEvent(QPaintEvent *event)
p.setFont(headingFont);
p.setPen(titlePen);

const int msgStampWidth = QFontMetrics(QFont{}).width(lastMsgInfo_.timestamp) + 4;
QFont tsFont;
tsFont.setPointSizeF(tsFont.pointSizeF() * 0.9);
const int msgStampWidth = QFontMetrics(tsFont).width(lastMsgInfo_.timestamp) + 4;

// We use the full width of the widget if there is no unread msg bubble.
const int bottomLineWidthLimit = (unreadMsgCount_ > 0) ? msgStampWidth : 0;
Expand Down Expand Up @@ -226,7 +228,7 @@ RoomInfoListItem::paintEvent(QPaintEvent *event)
else
p.setPen(QPen(timestampColor_));

p.setFont(QFont{});
p.setFont(tsFont);
p.drawText(QPoint(width() - wm.padding - msgStampWidth, top_y),
lastMsgInfo_.timestamp);
p.restore();
Expand Down

0 comments on commit 184c8b2

Please sign in to comment.