Use a smaller font size for the timestamp

This commit is contained in:
Konstantinos Sideris 2018-10-07 16:32:46 +03:00
parent f272d9221e
commit 184c8b28e9

View file

@ -175,7 +175,9 @@ RoomInfoListItem::paintEvent(QPaintEvent *event)
p.setFont(headingFont); p.setFont(headingFont);
p.setPen(titlePen); 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. // We use the full width of the widget if there is no unread msg bubble.
const int bottomLineWidthLimit = (unreadMsgCount_ > 0) ? msgStampWidth : 0; const int bottomLineWidthLimit = (unreadMsgCount_ > 0) ? msgStampWidth : 0;
@ -226,7 +228,7 @@ RoomInfoListItem::paintEvent(QPaintEvent *event)
else else
p.setPen(QPen(timestampColor_)); p.setPen(QPen(timestampColor_));
p.setFont(QFont{}); p.setFont(tsFont);
p.drawText(QPoint(width() - wm.padding - msgStampWidth, top_y), p.drawText(QPoint(width() - wm.padding - msgStampWidth, top_y),
lastMsgInfo_.timestamp); lastMsgInfo_.timestamp);
p.restore(); p.restore();