summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJoe Donofry <joe@joedonofry.com>2019-01-12 14:35:56 +0000
committerJoe Donofry <joe@joedonofry.com>2019-01-12 14:35:56 +0000
commitae91bab07d737bcf91bb7ae2210b4a74d846b9b7 (patch)
tree6105723919702b7d0acee300220cafb38e658d48 /src
parentIncrease the height of the roomlist items (diff)
downloadnheko-ae91bab07d737bcf91bb7ae2210b4a74d846b9b7.tar.xz
Tweak some of the colors in the CSS rules for nheko.
Add room list hover title/subtitle color change support.
Diffstat (limited to 'src')
-rw-r--r--src/RoomInfoListItem.cpp4
-rw-r--r--src/RoomInfoListItem.h12
2 files changed, 16 insertions, 0 deletions
diff --git a/src/RoomInfoListItem.cpp b/src/RoomInfoListItem.cpp
index 10908d88..e9cae165 100644
--- a/src/RoomInfoListItem.cpp
+++ b/src/RoomInfoListItem.cpp
@@ -158,8 +158,12 @@ RoomInfoListItem::paintEvent(QPaintEvent *event)
                 subtitlePen.setColor(highlightedSubtitleColor_);
         } else if (underMouse()) {
                 p.fillRect(rect(), hoverBackgroundColor_);
+                titlePen.setColor(hoverTitleColor_);
+                subtitlePen.setColor(hoverSubtitleColor_);
         } else {
                 p.fillRect(rect(), backgroundColor_);
+                titlePen.setColor(titleColor_);
+                subtitlePen.setColor(subtitleColor_);
         }
 
         QRect avatarRegion(wm.padding, wm.padding, wm.iconSize, wm.iconSize);
diff --git a/src/RoomInfoListItem.h b/src/RoomInfoListItem.h
index 46baa40d..4f3e9372 100644
--- a/src/RoomInfoListItem.h
+++ b/src/RoomInfoListItem.h
@@ -55,6 +55,11 @@ class RoomInfoListItem : public QWidget
         Q_PROPERTY(QColor highlightedSubtitleColor READ highlightedSubtitleColor WRITE
                      setHighlightedSubtitleColor)
 
+        Q_PROPERTY(
+          QColor hoverTitleColor READ hoverTitleColor WRITE setHoverTitleColor)
+        Q_PROPERTY(QColor hoverSubtitleColor READ hoverSubtitleColor WRITE
+                     setHoverSubtitleColor)
+
         Q_PROPERTY(QColor btnColor READ btnColor WRITE setBtnColor)
         Q_PROPERTY(QColor btnTextColor READ btnTextColor WRITE setBtnTextColor)
 
@@ -74,6 +79,8 @@ public:
 
         QColor highlightedBackgroundColor() const { return highlightedBackgroundColor_; }
         QColor hoverBackgroundColor() const { return hoverBackgroundColor_; }
+        QColor hoverTitleColor() const { return hoverTitleColor_; }
+        QColor hoverSubtitleColor() const { return hoverSubtitleColor_; }
         QColor backgroundColor() const { return backgroundColor_; }
         QColor avatarBgColor() const { return avatarBgColor_; }
         QColor avatarFgColor() const { return avatarFgColor_; }
@@ -93,6 +100,8 @@ public:
 
         void setHighlightedBackgroundColor(QColor &color) { highlightedBackgroundColor_ = color; }
         void setHoverBackgroundColor(QColor &color) { hoverBackgroundColor_ = color; }
+        void setHoverSubtitleColor(QColor &color) { hoverSubtitleColor_ = color; }
+        void setHoverTitleColor(QColor &color) { hoverTitleColor_ = color; }
         void setBackgroundColor(QColor &color) { backgroundColor_ = color; }
         void setTimestampColor(QColor &color) { timestampColor_ = color; }
         void setAvatarFgColor(QColor &color) { avatarFgColor_ = color; }
@@ -186,6 +195,9 @@ private:
         QColor titleColor_;
         QColor subtitleColor_;
 
+        QColor hoverTitleColor_;
+        QColor hoverSubtitleColor_;
+
         QColor btnColor_;
         QColor btnTextColor_;