From 7ca2b188a86d6b0cf06461908f403f127fa2babd Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 30 Apr 2017 01:20:36 +0100 Subject: [PATCH] fix wonky avatar layout on MacOS surely the maximum size for the text should be the width of the parent (i.e. topLayout) minus the width of the avatar layout, which is max_height_? --- src/RoomInfoListItem.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/RoomInfoListItem.cc b/src/RoomInfoListItem.cc index 41593a42..8bb96778 100644 --- a/src/RoomInfoListItem.cc +++ b/src/RoomInfoListItem.cc @@ -77,12 +77,12 @@ RoomInfoListItem::RoomInfoListItem(RoomInfo info, QWidget *parent) avatarLayout_->addWidget(roomAvatar_); roomName_ = new QLabel(info_.name(), textWidget_); - roomName_->setMaximumSize(parent->width() - 10, 20); + roomName_->setMaximumSize(parent->width() - max_height_, 20); roomName_->setStyleSheet("font-weight: 400; font-size: 14px;"); roomName_->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); roomTopic_ = new QLabel(info_.topic(), textWidget_); - roomTopic_->setMaximumSize(parent->width() - 10, 20); + roomTopic_->setMaximumSize(parent->width() - max_height_, 20); roomTopic_->setStyleSheet("color: #171919; font-size: 12px"); roomTopic_->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); @@ -92,8 +92,8 @@ RoomInfoListItem::RoomInfoListItem(RoomInfo info, QWidget *parent) topLayout_->addWidget(avatarWidget_); topLayout_->addWidget(textWidget_); - setElidedText(roomName_, info_.name(), parent->width() - 10); - setElidedText(roomTopic_, info_.topic(), parent->width() - 10); + setElidedText(roomName_, info_.name(), parent->width() - max_height_); + setElidedText(roomTopic_, info_.topic(), parent->width() - max_height_); QPainterPath path; path.addRoundedRect(rect(), 0, 0);