Adjust unread msg bubble

This commit is contained in:
Konstantinos Sideris 2018-03-20 21:23:01 +02:00
parent 42733eeb86
commit 480de2d30b
3 changed files with 18 additions and 11 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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);