diff --git a/src/colorscheme.cpp b/src/colorscheme.cpp index 8a430b56c..91ee5fa9e 100644 --- a/src/colorscheme.cpp +++ b/src/colorscheme.cpp @@ -57,6 +57,8 @@ void ColorScheme::setColors(double hue, double multiplier) { lightTheme = multiplier > 0; + qreal sat = 0.05; + SystemMessageColor = QColor(140, 127, 127); auto getColor = [multiplier](double h, double s, double l, double a = 1.0) { @@ -97,19 +99,21 @@ void ColorScheme::setColors(double hue, double multiplier) TabNewMessageBackground = QBrush(QColor::fromHslF(hue, 0.5, 0.8), Qt::DiagCrossPattern); // Chat - ChatBackground = getColor(0, 0.1, 1); + bool flat = lightTheme; + + ChatBackground = getColor(0, sat, 1); ChatBackgroundHighlighted = blendColors(TabSelectedBackground, ChatBackground, 0.8); - ChatHeaderBackground = getColor(0, 0.1, 0.9); - ChatHeaderBorder = getColor(0, 0.1, 0.85); - ChatInputBackground = getColor(0, 0.1, 0.95); - ChatInputBorder = getColor(0, 0.1, 0.9); + ChatHeaderBackground = getColor(0, sat, flat ? 1 : 0.9); + ChatHeaderBorder = getColor(0, sat, flat ? 1 : 0.85); + ChatInputBackground = getColor(0, sat, flat ? 0.95 : 0.95); + ChatInputBorder = getColor(0, sat, flat ? 1 : 1); ChatSeperator = lightTheme ? QColor(127, 127, 127) : QColor(80, 80, 80); // Scrollbar - ScrollbarBG = ChatBackground; - ScrollbarThumb = getColor(0, 0.1, 0.85); - ScrollbarThumbSelected = getColor(0, 0.1, 0.7); - ScrollbarArrow = getColor(0, 0.1, 0.9); + ScrollbarBG = getColor(0, sat, 0.90); + ScrollbarThumb = getColor(0, sat, 0.80); + ScrollbarThumbSelected = getColor(0, sat, 0.7); + ScrollbarArrow = getColor(0, sat, 0.9); // stylesheet InputStyleSheet = "background:" + ChatInputBackground.name() + ";" + diff --git a/src/widgets/helper/splitinput.cpp b/src/widgets/helper/splitinput.cpp index ed43f9857..8f9fe3201 100644 --- a/src/widgets/helper/splitinput.cpp +++ b/src/widgets/helper/splitinput.cpp @@ -22,7 +22,7 @@ SplitInput::SplitInput(Split *_chatWidget) this->setLayout(&this->hbox); - this->hbox.setMargin(0); + this->hbox.setMargin(4); this->hbox.addLayout(&this->editContainer); this->hbox.addLayout(&this->vbox); @@ -37,7 +37,7 @@ SplitInput::SplitInput(Split *_chatWidget) })); this->editContainer.addWidget(&this->textInput); - this->editContainer.setMargin(4); + this->editContainer.setMargin(2); this->emotesLabel.setMinimumHeight(24); @@ -215,6 +215,8 @@ void SplitInput::refreshTheme() this->textLengthLabel.setPalette(palette); this->textInput.setStyleSheet(this->colorScheme.InputStyleSheet); + + this->hbox.setMargin((this->colorScheme.isLightTheme() ? 4 : 2) * this->getDpiMultiplier()); } void SplitInput::editTextChanged() @@ -243,7 +245,12 @@ void SplitInput::paintEvent(QPaintEvent *) QPainter painter(this); painter.fillRect(this->rect(), this->colorScheme.ChatInputBackground); - painter.setPen(this->colorScheme.ChatInputBorder); + + QPen pen(this->colorScheme.ChatInputBorder); + if (this->colorScheme.isLightTheme()) { + pen.setWidth((int)(6 * this->getDpiMultiplier())); + } + painter.setPen(pen); painter.drawRect(0, 0, this->width() - 1, this->height() - 1); } @@ -254,6 +261,8 @@ void SplitInput::resizeEvent(QResizeEvent *) } else { this->textInput.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); } + + this->refreshTheme(); } void SplitInput::mousePressEvent(QMouseEvent *) diff --git a/src/widgets/scrollbar.cpp b/src/widgets/scrollbar.cpp index 08b742c5b..90eee65e9 100644 --- a/src/widgets/scrollbar.cpp +++ b/src/widgets/scrollbar.cpp @@ -244,6 +244,11 @@ void ScrollBar::paintEvent(QPaintEvent *) this->mutex.unlock(); } +void ScrollBar::resizeEvent(QResizeEvent *) +{ + this->resize((int)(16 * this->getDpiMultiplier()), this->height()); +} + void ScrollBar::mouseMoveEvent(QMouseEvent *event) { if (this->mouseDownIndex == -1) { diff --git a/src/widgets/scrollbar.hpp b/src/widgets/scrollbar.hpp index 08162b480..4e6407159 100644 --- a/src/widgets/scrollbar.hpp +++ b/src/widgets/scrollbar.hpp @@ -52,6 +52,14 @@ public: void printCurrentState(const QString &prefix = QString()) const; +protected: + void paintEvent(QPaintEvent *) override; + void resizeEvent(QResizeEvent *) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void leaveEvent(QEvent *) override; + private: Q_PROPERTY(qreal currentValue READ getCurrentValue WRITE setCurrentValue) @@ -61,19 +69,14 @@ private: ScrollBarHighlight *highlights; - void paintEvent(QPaintEvent *); - void mouseMoveEvent(QMouseEvent *event); - void mousePressEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - void leaveEvent(QEvent *); - bool atBottom = false; int mouseOverIndex = -1; int mouseDownIndex = -1; QPoint lastMousePosition; - int buttonHeight = 16; + // int buttonHeight = 16; + int buttonHeight = 0; int trackHeight = 100; QRect thumbRect;