From 480de2d30bcd82ed3beeab5fad9b2a55d34b4990 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Tue, 20 Mar 2018 21:23:01 +0200 Subject: [PATCH] Adjust unread msg bubble --- include/Config.h | 6 +++--- resources/styles/nheko.qss | 5 ++++- src/RoomInfoListItem.cc | 18 +++++++++++------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/include/Config.h b/include/Config.h index 40276df..33cc63f 100644 --- a/include/Config.h +++ b/include/Config.h @@ -56,9 +56,9 @@ static constexpr int cornerRadius = 3; // RoomList specific. namespace roomlist { namespace fonts { -static constexpr int heading = 14; -static constexpr int timestamp = heading - 1; -static constexpr int badge = 10; +static constexpr int heading = 13; +static constexpr int timestamp = heading; +static constexpr int badge = 9; static constexpr int bubble = 20; } // namespace fonts } // namespace roomlist diff --git a/resources/styles/nheko.qss b/resources/styles/nheko.qss index 1ed3049..e158d76 100644 --- a/resources/styles/nheko.qss +++ b/resources/styles/nheko.qss @@ -50,7 +50,7 @@ RaisedButton { RoomInfoListItem { qproperty-highlightedBackgroundColor: #38A3D8; - qproperty-hoverBackgroundColor: rgba(200, 200, 200, 128); + qproperty-hoverBackgroundColor: rgba(200, 200, 200, 100); qproperty-backgroundColor: white; qproperty-titleColor: #333; @@ -67,6 +67,9 @@ RoomInfoListItem { qproperty-avatarBgColor: #eee; qproperty-avatarFgColor: black; + + qproperty-bubbleFgColor: white; + qproperty-bubbleBgColor: #38A3D8; } CommunitiesListItem { diff --git a/src/RoomInfoListItem.cc b/src/RoomInfoListItem.cc index 5793dc9..8041915 100644 --- a/src/RoomInfoListItem.cc +++ b/src/RoomInfoListItem.cc @@ -30,6 +30,8 @@ #include "Theme.h" #include "Utils.h" +constexpr int BubbleDiameter = 18; + constexpr int Padding = 9; constexpr int IconSize = 44; constexpr int MaxHeight = IconSize + 2 * Padding; @@ -68,7 +70,7 @@ RoomInfoListItem::init(QWidget *parent) timestampFont_.setBold(false); headingFont_ = font_; - headingFont_.setPixelSize(conf::roomlist::fonts::heading - 1); + headingFont_.setPixelSize(conf::roomlist::fonts::heading); headingFont_.setWeight(60); } @@ -291,14 +293,16 @@ RoomInfoListItem::paintEvent(QPaintEvent *event) p.setPen(Qt::NoPen); p.setFont(unreadCountFont_); - int diameter = 20; - - QRectF r( - width() - diameter - Padding, bottom_y - diameter / 2 - 5, diameter, diameter); + QRectF r(width() - BubbleDiameter - Padding, + bottom_y - BubbleDiameter / 2 - 5, + BubbleDiameter, + BubbleDiameter); if (width() == ui::sidebar::SmallSize) - r = QRectF( - width() - diameter - 5, height() - diameter - 5, diameter, diameter); + r = QRectF(width() - BubbleDiameter - 5, + height() - BubbleDiameter - 5, + BubbleDiameter, + BubbleDiameter); p.setPen(Qt::NoPen); p.drawEllipse(r);