Adjust unread msg bubble

remotes/origin/HEAD
Konstantinos Sideris 7 years ago
parent 42733eeb86
commit 480de2d30b
  1. 6
      include/Config.h
  2. 5
      resources/styles/nheko.qss
  3. 18
      src/RoomInfoListItem.cc

@ -56,9 +56,9 @@ static constexpr int cornerRadius = 3;
// RoomList specific. // RoomList specific.
namespace roomlist { namespace roomlist {
namespace fonts { namespace fonts {
static constexpr int heading = 14; static constexpr int heading = 13;
static constexpr int timestamp = heading - 1; static constexpr int timestamp = heading;
static constexpr int badge = 10; static constexpr int badge = 9;
static constexpr int bubble = 20; static constexpr int bubble = 20;
} // namespace fonts } // namespace fonts
} // namespace roomlist } // namespace roomlist

@ -50,7 +50,7 @@ RaisedButton {
RoomInfoListItem { RoomInfoListItem {
qproperty-highlightedBackgroundColor: #38A3D8; qproperty-highlightedBackgroundColor: #38A3D8;
qproperty-hoverBackgroundColor: rgba(200, 200, 200, 128); qproperty-hoverBackgroundColor: rgba(200, 200, 200, 100);
qproperty-backgroundColor: white; qproperty-backgroundColor: white;
qproperty-titleColor: #333; qproperty-titleColor: #333;
@ -67,6 +67,9 @@ RoomInfoListItem {
qproperty-avatarBgColor: #eee; qproperty-avatarBgColor: #eee;
qproperty-avatarFgColor: black; qproperty-avatarFgColor: black;
qproperty-bubbleFgColor: white;
qproperty-bubbleBgColor: #38A3D8;
} }
CommunitiesListItem { CommunitiesListItem {

@ -30,6 +30,8 @@
#include "Theme.h" #include "Theme.h"
#include "Utils.h" #include "Utils.h"
constexpr int BubbleDiameter = 18;
constexpr int Padding = 9; constexpr int Padding = 9;
constexpr int IconSize = 44; constexpr int IconSize = 44;
constexpr int MaxHeight = IconSize + 2 * Padding; constexpr int MaxHeight = IconSize + 2 * Padding;
@ -68,7 +70,7 @@ RoomInfoListItem::init(QWidget *parent)
timestampFont_.setBold(false); timestampFont_.setBold(false);
headingFont_ = font_; headingFont_ = font_;
headingFont_.setPixelSize(conf::roomlist::fonts::heading - 1); headingFont_.setPixelSize(conf::roomlist::fonts::heading);
headingFont_.setWeight(60); headingFont_.setWeight(60);
} }
@ -291,14 +293,16 @@ RoomInfoListItem::paintEvent(QPaintEvent *event)
p.setPen(Qt::NoPen); p.setPen(Qt::NoPen);
p.setFont(unreadCountFont_); p.setFont(unreadCountFont_);
int diameter = 20; QRectF r(width() - BubbleDiameter - Padding,
bottom_y - BubbleDiameter / 2 - 5,
QRectF r( BubbleDiameter,
width() - diameter - Padding, bottom_y - diameter / 2 - 5, diameter, diameter); BubbleDiameter);
if (width() == ui::sidebar::SmallSize) if (width() == ui::sidebar::SmallSize)
r = QRectF( r = QRectF(width() - BubbleDiameter - 5,
width() - diameter - 5, height() - diameter - 5, diameter, diameter); height() - BubbleDiameter - 5,
BubbleDiameter,
BubbleDiameter);
p.setPen(Qt::NoPen); p.setPen(Qt::NoPen);
p.drawEllipse(r); p.drawEllipse(r);

Loading…
Cancel
Save