From c8ce55a54e933dabcc104603acd83b990b287792 Mon Sep 17 00:00:00 2001 From: fourtf Date: Sat, 5 Aug 2017 18:15:23 +0200 Subject: [PATCH] checked scrollbar colors --- src/colorscheme.cpp | 3 +++ src/colorscheme.hpp | 1 + src/widgets/scrollbar.cpp | 13 ++++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/colorscheme.cpp b/src/colorscheme.cpp index 00e66427d..b049598eb 100644 --- a/src/colorscheme.cpp +++ b/src/colorscheme.cpp @@ -97,6 +97,9 @@ void ColorScheme::setColors(double hue, double multiplier) ChatInputBorder = getColor(0, 0.1, 0.9); ScrollbarBG = ChatBackground; + ScrollbarThumb = getColor(0, 0.1, 0.85); + ScrollbarThumbSelected = getColor(0, 0.1, 0.7); + ScrollbarArrow = getColor(0, 0.1, 0.4); // generate color lookuptable fillLookupTableValues(this->middleLookupTable, 0.000, 0.166, 0.66, 0.5); diff --git a/src/colorscheme.hpp b/src/colorscheme.hpp index ad8ccae9f..13e59c045 100644 --- a/src/colorscheme.hpp +++ b/src/colorscheme.hpp @@ -49,6 +49,7 @@ public: QColor TextFocused; QColor Menu; QColor MenuBorder; + QColor ScrollbarBG; QColor ScrollbarThumb; QColor ScrollbarThumbSelected; diff --git a/src/widgets/scrollbar.cpp b/src/widgets/scrollbar.cpp index 73f4de5d1..7f7fc7b53 100644 --- a/src/widgets/scrollbar.cpp +++ b/src/widgets/scrollbar.cpp @@ -199,10 +199,17 @@ void ScrollBar::paintEvent(QPaintEvent *) QPainter painter(this); painter.fillRect(rect(), this->colorScheme.ScrollbarBG); - painter.fillRect(QRect(0, 0, width(), _buttonHeight), QColor(255, 0, 0)); - painter.fillRect(QRect(0, height() - _buttonHeight, width(), _buttonHeight), QColor(255, 0, 0)); + painter.fillRect(QRect(0, 0, width(), _buttonHeight), this->colorScheme.ScrollbarArrow); + painter.fillRect(QRect(0, height() - _buttonHeight, width(), _buttonHeight), this->colorScheme.ScrollbarArrow); - painter.fillRect(_thumbRect, QColor(0, 255, 255)); + // mouse over thumb + if (this->_mouseDownIndex == 2) { + painter.fillRect(_thumbRect, this->colorScheme.ScrollbarThumbSelected); + } + // mouse not over thumb + else { + painter.fillRect(_thumbRect, this->colorScheme.ScrollbarThumb); + } // ScrollBarHighlight *highlight = highlights;