diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-12-05 14:13:26 +0200 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-12-05 14:13:26 +0200 |
commit | 6415c4125f296c3d32946c1ea66256f1dad0a1eb (patch) | |
tree | 5f677cc5fcf2f2ed253d0e9605d43ce67c8af072 /include/ui | |
parent | Update dependencies (diff) | |
download | nheko-6415c4125f296c3d32946c1ea66256f1dad0a1eb.tar.xz |
Add style colors for the ScrollBar
Diffstat (limited to 'include/ui')
-rw-r--r-- | include/ui/ScrollBar.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/ui/ScrollBar.h b/include/ui/ScrollBar.h index 1c056409..fe8ba64a 100644 --- a/include/ui/ScrollBar.h +++ b/include/ui/ScrollBar.h @@ -26,12 +26,21 @@ class ScrollBar : public QScrollBar { Q_OBJECT + Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor) + Q_PROPERTY(QColor handleColor READ handleColor WRITE setHandleColor) + public: ScrollBar(QScrollArea *area, QWidget *parent = nullptr); void fadeIn(); void fadeOut(); + QColor backgroundColor() const { return bgColor_; } + void setBackgroundColor(QColor &color) { bgColor_ = color; } + + QColor handleColor() const { return handleColor_; } + void setHandleColor(QColor &color) { handleColor_ = color; } + protected: void paintEvent(QPaintEvent *e) override; void sliderChange(SliderChange change) override; @@ -50,4 +59,7 @@ private: QScrollArea *area_; QRect handle_; + + QColor bgColor_ = QColor(33, 33, 33, 30); + QColor handleColor_ = QColor(0, 0, 0, 80); }; |