From 8299a74775bcdf917d58038fd35b2fdd208d4154 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Thu, 19 Oct 2017 19:04:51 +0300 Subject: Elide room topic --- include/TopRoomBar.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/TopRoomBar.h b/include/TopRoomBar.h index 2c7af218..87037574 100644 --- a/include/TopRoomBar.h +++ b/include/TopRoomBar.h @@ -83,6 +83,9 @@ private: Avatar *avatar_; int buttonSize_; + + QString roomName_; + QString roomTopic_; }; inline void @@ -102,9 +105,7 @@ TopRoomBar::updateRoomAvatar(const QIcon &icon) inline void TopRoomBar::updateRoomName(const QString &name) { - QString elidedText = - QFontMetrics(nameLabel_->font()).elidedText(name, Qt::ElideRight, width() * 0.8); - nameLabel_->setText(elidedText); + roomName_ = name; update(); } @@ -112,10 +113,6 @@ inline void TopRoomBar::updateRoomTopic(QString topic) { topic.replace(URL_REGEX, URL_HTML); - - QString elidedText = - QFontMetrics(topicLabel_->font()).elidedText(topic, Qt::ElideRight, width() * 0.6); - - topicLabel_->setText(topic); + roomTopic_ = topic; update(); } -- cgit 1.5.1