tweaked the light themes

This commit is contained in:
fourtf
2017-12-26 16:54:39 +01:00
parent 37ca3cd79e
commit 4e4cc9223e
4 changed files with 40 additions and 19 deletions
+12 -3
View File
@@ -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 *)
+5
View File
@@ -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) {
+10 -7
View File
@@ -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;