mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Use a smaller font size for the timestamp
This commit is contained in:
parent
f272d9221e
commit
184c8b28e9
1 changed files with 4 additions and 2 deletions
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue