From 6415c4125f296c3d32946c1ea66256f1dad0a1eb Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Tue, 5 Dec 2017 14:13:26 +0200 Subject: Add style colors for the ScrollBar --- include/ui/ScrollBar.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/ui') 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); }; -- cgit 1.4.1