From d2d65b6662b57edc99d31b6edf47a5f2942d01a8 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Mon, 19 Mar 2018 20:26:14 +0200 Subject: [PATCH] More stylistic changes & dark theme tweaks --- include/RoomInfoListItem.h | 12 ++++++++++++ resources/styles/nheko-dark.qss | 15 +++++++++------ resources/styles/nheko.qss | 2 +- src/RoomInfoListItem.cc | 11 ++++------- src/timeline/TimelineItem.cc | 8 ++++++-- 5 files changed, 32 insertions(+), 16 deletions(-) diff --git a/include/RoomInfoListItem.h b/include/RoomInfoListItem.h index 7da6c418..35214c30 100644 --- a/include/RoomInfoListItem.h +++ b/include/RoomInfoListItem.h @@ -51,6 +51,9 @@ class RoomInfoListItem : public QWidget Q_PROPERTY(QColor avatarBgColor READ avatarBgColor WRITE setAvatarBgColor) Q_PROPERTY(QColor avatarFgColor READ avatarFgColor WRITE setAvatarFgColor) + Q_PROPERTY(QColor bubbleBgColor READ bubbleBgColor WRITE setBubbleBgColor) + Q_PROPERTY(QColor bubbleFgColor READ bubbleFgColor WRITE setBubbleFgColor) + Q_PROPERTY(QColor titleColor READ titleColor WRITE setTitleColor) Q_PROPERTY(QColor subtitleColor READ subtitleColor WRITE setSubtitleColor) @@ -107,6 +110,9 @@ public: QColor btnColor() const { return btnColor_; } QColor btnTextColor() const { return btnTextColor_; } + QColor bubbleFgColor() const { return bubbleFgColor_; } + QColor bubbleBgColor() const { return bubbleBgColor_; } + void setHighlightedBackgroundColor(QColor &color) { highlightedBackgroundColor_ = color; } void setHoverBackgroundColor(QColor &color) { hoverBackgroundColor_ = color; } void setBackgroundColor(QColor &color) { backgroundColor_ = color; } @@ -124,6 +130,9 @@ public: void setBtnColor(QColor &color) { btnColor_ = color; } void setBtnTextColor(QColor &color) { btnTextColor_ = color; } + void setBubbleFgColor(QColor &color) { bubbleFgColor_ = color; } + void setBubbleBgColor(QColor &color) { bubbleBgColor_ = color; } + signals: void clicked(const QString &room_id); void leaveRoom(const QString &room_id); @@ -213,4 +222,7 @@ private: QColor avatarBgColor_; QColor avatarFgColor_; + + QColor bubbleBgColor_; + QColor bubbleFgColor_; }; diff --git a/resources/styles/nheko-dark.qss b/resources/styles/nheko-dark.qss index 9a354d3a..f84b9300 100644 --- a/resources/styles/nheko-dark.qss +++ b/resources/styles/nheko-dark.qss @@ -29,19 +29,19 @@ CommunitiesList > * { } FlatButton { - qproperty-foregroundColor: #caccd1; + qproperty-foregroundColor: #727274; qproperty-backgroundColor: #333; } FileItem { qproperty-textColor: #caccd1; - qproperty-backgroundColor: #414A59; + qproperty-backgroundColor: #2d3139; qproperty-iconColor: #caccd1; } AudioItem { qproperty-textColor: #caccd1; - qproperty-backgroundColor: #414A59; + qproperty-backgroundColor: #2d3139; qproperty-iconColor: #caccd1; } @@ -69,6 +69,9 @@ RoomInfoListItem { qproperty-avatarBgColor: #202228; qproperty-avatarFgColor: white; + + qproperty-bubbleFgColor: white; + qproperty-bubbleBgColor: #4d84c7; } CommunitiesListItem { @@ -144,8 +147,8 @@ emoji--Category > * { } FloatingButton { - qproperty-backgroundColor: #efefef; - qproperty-foregroundColor: black; + qproperty-backgroundColor: #2d3139; + qproperty-foregroundColor: white; } TextField { @@ -155,7 +158,7 @@ TextField { } ScrollBar { - qproperty-handleColor: #caccd1; + qproperty-handleColor: #2d3139; qproperty-backgroundColor: #202228; } diff --git a/resources/styles/nheko.qss b/resources/styles/nheko.qss index cb8f50e5..1ed3049b 100644 --- a/resources/styles/nheko.qss +++ b/resources/styles/nheko.qss @@ -29,7 +29,7 @@ CommunitiesList > * { } FlatButton { - qproperty-foregroundColor: #333; + qproperty-foregroundColor: #8c8c8c; } FileItem { diff --git a/src/RoomInfoListItem.cc b/src/RoomInfoListItem.cc index 3a422787..5793dc98 100644 --- a/src/RoomInfoListItem.cc +++ b/src/RoomInfoListItem.cc @@ -280,15 +280,12 @@ RoomInfoListItem::paintEvent(QPaintEvent *event) } if (unreadMsgCount_ > 0) { - QColor textColor("white"); - QColor backgroundColor("#38A3D8"); - QBrush brush; brush.setStyle(Qt::SolidPattern); - brush.setColor(backgroundColor); + brush.setColor(bubbleBgColor()); if (isPressed_) - brush.setColor(textColor); + brush.setColor(bubbleFgColor()); p.setBrush(brush); p.setPen(Qt::NoPen); @@ -306,10 +303,10 @@ RoomInfoListItem::paintEvent(QPaintEvent *event) p.setPen(Qt::NoPen); p.drawEllipse(r); - p.setPen(QPen(textColor)); + p.setPen(QPen(bubbleFgColor())); if (isPressed_) - p.setPen(QPen(backgroundColor)); + p.setPen(QPen(bubbleBgColor())); p.setBrush(Qt::NoBrush); p.drawText( diff --git a/src/timeline/TimelineItem.cc b/src/timeline/TimelineItem.cc index 371ced10..326b2c14 100644 --- a/src/timeline/TimelineItem.cc +++ b/src/timeline/TimelineItem.cc @@ -31,6 +31,10 @@ constexpr const static char *CHECKMARK = "✓"; +constexpr int MSG_RIGHT_MARGIN = 7; +constexpr int MSG_BOTTOM_MARGIN = 4; +constexpr int MSG_PADDING = 20; + void TimelineItem::init() { @@ -68,8 +72,8 @@ TimelineItem::init() topLayout_ = new QHBoxLayout(this); mainLayout_ = new QVBoxLayout; messageLayout_ = new QHBoxLayout; - messageLayout_->setContentsMargins(0, 0, 20, 4); - messageLayout_->setSpacing(20); + messageLayout_->setContentsMargins(0, 0, MSG_RIGHT_MARGIN, MSG_BOTTOM_MARGIN); + messageLayout_->setSpacing(MSG_PADDING); topLayout_->setContentsMargins(conf::timeline::msgMargin, conf::timeline::msgMargin, 0, 0); topLayout_->setSpacing(0);