summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-12-05 14:13:26 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-12-05 14:13:26 +0200
commit6415c4125f296c3d32946c1ea66256f1dad0a1eb (patch)
tree5f677cc5fcf2f2ed253d0e9605d43ce67c8af072 /include
parentd6e6ec25817cd670cd2713906c488b3e3a41003d (diff)
Add style colors for the ScrollBar
Diffstat (limited to 'include')
-rw-r--r--include/ui/ScrollBar.h12
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);
};