mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
tweaked the light themes
This commit is contained in:
parent
37ca3cd79e
commit
4e4cc9223e
4 changed files with 40 additions and 19 deletions
|
@ -57,6 +57,8 @@ void ColorScheme::setColors(double hue, double multiplier)
|
||||||
{
|
{
|
||||||
lightTheme = multiplier > 0;
|
lightTheme = multiplier > 0;
|
||||||
|
|
||||||
|
qreal sat = 0.05;
|
||||||
|
|
||||||
SystemMessageColor = QColor(140, 127, 127);
|
SystemMessageColor = QColor(140, 127, 127);
|
||||||
|
|
||||||
auto getColor = [multiplier](double h, double s, double l, double a = 1.0) {
|
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);
|
TabNewMessageBackground = QBrush(QColor::fromHslF(hue, 0.5, 0.8), Qt::DiagCrossPattern);
|
||||||
|
|
||||||
// Chat
|
// Chat
|
||||||
ChatBackground = getColor(0, 0.1, 1);
|
bool flat = lightTheme;
|
||||||
|
|
||||||
|
ChatBackground = getColor(0, sat, 1);
|
||||||
ChatBackgroundHighlighted = blendColors(TabSelectedBackground, ChatBackground, 0.8);
|
ChatBackgroundHighlighted = blendColors(TabSelectedBackground, ChatBackground, 0.8);
|
||||||
ChatHeaderBackground = getColor(0, 0.1, 0.9);
|
ChatHeaderBackground = getColor(0, sat, flat ? 1 : 0.9);
|
||||||
ChatHeaderBorder = getColor(0, 0.1, 0.85);
|
ChatHeaderBorder = getColor(0, sat, flat ? 1 : 0.85);
|
||||||
ChatInputBackground = getColor(0, 0.1, 0.95);
|
ChatInputBackground = getColor(0, sat, flat ? 0.95 : 0.95);
|
||||||
ChatInputBorder = getColor(0, 0.1, 0.9);
|
ChatInputBorder = getColor(0, sat, flat ? 1 : 1);
|
||||||
ChatSeperator = lightTheme ? QColor(127, 127, 127) : QColor(80, 80, 80);
|
ChatSeperator = lightTheme ? QColor(127, 127, 127) : QColor(80, 80, 80);
|
||||||
|
|
||||||
// Scrollbar
|
// Scrollbar
|
||||||
ScrollbarBG = ChatBackground;
|
ScrollbarBG = getColor(0, sat, 0.90);
|
||||||
ScrollbarThumb = getColor(0, 0.1, 0.85);
|
ScrollbarThumb = getColor(0, sat, 0.80);
|
||||||
ScrollbarThumbSelected = getColor(0, 0.1, 0.7);
|
ScrollbarThumbSelected = getColor(0, sat, 0.7);
|
||||||
ScrollbarArrow = getColor(0, 0.1, 0.9);
|
ScrollbarArrow = getColor(0, sat, 0.9);
|
||||||
|
|
||||||
// stylesheet
|
// stylesheet
|
||||||
InputStyleSheet = "background:" + ChatInputBackground.name() + ";" +
|
InputStyleSheet = "background:" + ChatInputBackground.name() + ";" +
|
||||||
|
|
|
@ -22,7 +22,7 @@ SplitInput::SplitInput(Split *_chatWidget)
|
||||||
|
|
||||||
this->setLayout(&this->hbox);
|
this->setLayout(&this->hbox);
|
||||||
|
|
||||||
this->hbox.setMargin(0);
|
this->hbox.setMargin(4);
|
||||||
|
|
||||||
this->hbox.addLayout(&this->editContainer);
|
this->hbox.addLayout(&this->editContainer);
|
||||||
this->hbox.addLayout(&this->vbox);
|
this->hbox.addLayout(&this->vbox);
|
||||||
|
@ -37,7 +37,7 @@ SplitInput::SplitInput(Split *_chatWidget)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this->editContainer.addWidget(&this->textInput);
|
this->editContainer.addWidget(&this->textInput);
|
||||||
this->editContainer.setMargin(4);
|
this->editContainer.setMargin(2);
|
||||||
|
|
||||||
this->emotesLabel.setMinimumHeight(24);
|
this->emotesLabel.setMinimumHeight(24);
|
||||||
|
|
||||||
|
@ -215,6 +215,8 @@ void SplitInput::refreshTheme()
|
||||||
this->textLengthLabel.setPalette(palette);
|
this->textLengthLabel.setPalette(palette);
|
||||||
|
|
||||||
this->textInput.setStyleSheet(this->colorScheme.InputStyleSheet);
|
this->textInput.setStyleSheet(this->colorScheme.InputStyleSheet);
|
||||||
|
|
||||||
|
this->hbox.setMargin((this->colorScheme.isLightTheme() ? 4 : 2) * this->getDpiMultiplier());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SplitInput::editTextChanged()
|
void SplitInput::editTextChanged()
|
||||||
|
@ -243,7 +245,12 @@ void SplitInput::paintEvent(QPaintEvent *)
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
|
|
||||||
painter.fillRect(this->rect(), this->colorScheme.ChatInputBackground);
|
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);
|
painter.drawRect(0, 0, this->width() - 1, this->height() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,6 +261,8 @@ void SplitInput::resizeEvent(QResizeEvent *)
|
||||||
} else {
|
} else {
|
||||||
this->textInput.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
this->textInput.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->refreshTheme();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SplitInput::mousePressEvent(QMouseEvent *)
|
void SplitInput::mousePressEvent(QMouseEvent *)
|
||||||
|
|
|
@ -244,6 +244,11 @@ void ScrollBar::paintEvent(QPaintEvent *)
|
||||||
this->mutex.unlock();
|
this->mutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScrollBar::resizeEvent(QResizeEvent *)
|
||||||
|
{
|
||||||
|
this->resize((int)(16 * this->getDpiMultiplier()), this->height());
|
||||||
|
}
|
||||||
|
|
||||||
void ScrollBar::mouseMoveEvent(QMouseEvent *event)
|
void ScrollBar::mouseMoveEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (this->mouseDownIndex == -1) {
|
if (this->mouseDownIndex == -1) {
|
||||||
|
|
|
@ -52,6 +52,14 @@ public:
|
||||||
|
|
||||||
void printCurrentState(const QString &prefix = QString()) const;
|
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:
|
private:
|
||||||
Q_PROPERTY(qreal currentValue READ getCurrentValue WRITE setCurrentValue)
|
Q_PROPERTY(qreal currentValue READ getCurrentValue WRITE setCurrentValue)
|
||||||
|
|
||||||
|
@ -61,19 +69,14 @@ private:
|
||||||
|
|
||||||
ScrollBarHighlight *highlights;
|
ScrollBarHighlight *highlights;
|
||||||
|
|
||||||
void paintEvent(QPaintEvent *);
|
|
||||||
void mouseMoveEvent(QMouseEvent *event);
|
|
||||||
void mousePressEvent(QMouseEvent *event);
|
|
||||||
void mouseReleaseEvent(QMouseEvent *event);
|
|
||||||
void leaveEvent(QEvent *);
|
|
||||||
|
|
||||||
bool atBottom = false;
|
bool atBottom = false;
|
||||||
|
|
||||||
int mouseOverIndex = -1;
|
int mouseOverIndex = -1;
|
||||||
int mouseDownIndex = -1;
|
int mouseDownIndex = -1;
|
||||||
QPoint lastMousePosition;
|
QPoint lastMousePosition;
|
||||||
|
|
||||||
int buttonHeight = 16;
|
// int buttonHeight = 16;
|
||||||
|
int buttonHeight = 0;
|
||||||
int trackHeight = 100;
|
int trackHeight = 100;
|
||||||
|
|
||||||
QRect thumbRect;
|
QRect thumbRect;
|
||||||
|
|
Loading…
Reference in a new issue