diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2019-12-13 21:05:28 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2019-12-13 21:05:28 +0100 |
commit | 932dbf38fe23130cb0b1e4bdcdab7d62e086432b (patch) | |
tree | d68654bab9da3dc210b8c4d91396b66bbaaebdda | |
parent | Make invites always stick to the top (diff) | |
download | nheko-932dbf38fe23130cb0b1e4bdcdab7d62e086432b.tar.xz |
Fix position of invite button and elide long button texts
-rw-r--r-- | src/RoomInfoListItem.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/RoomInfoListItem.cpp b/src/RoomInfoListItem.cpp index 77de8d5a..1e06d914 100644 --- a/src/RoomInfoListItem.cpp +++ b/src/RoomInfoListItem.cpp @@ -65,7 +65,7 @@ getMetrics(const QFont &font) m.unreadLineOffset = m.padding - m.padding / 4; m.inviteBtnX = m.iconSize + 2 * m.padding; - m.inviteBtnX = m.iconSize / 2.0 + m.padding + m.padding / 3.0; + m.inviteBtnY = m.iconSize / 2.0 + m.padding + m.padding / 3.0; return m; } @@ -241,8 +241,12 @@ RoomInfoListItem::paintEvent(QPaintEvent *event) p.setPen(QPen(btnTextColor_)); p.setFont(QFont{}); - p.drawText(acceptBtnRegion_, Qt::AlignCenter, tr("Accept")); - p.drawText(declineBtnRegion_, Qt::AlignCenter, tr("Decline")); + p.drawText(acceptBtnRegion_, + Qt::AlignCenter, + metrics.elidedText(tr("Accept"), Qt::ElideRight, btnWidth)); + p.drawText(declineBtnRegion_, + Qt::AlignCenter, + metrics.elidedText(tr("Decline"), Qt::ElideRight, btnWidth)); } } |