changes for light mode
This commit is contained in:
@@ -108,11 +108,7 @@ void SplitInput::initLayout()
|
||||
void SplitInput::scaleChangedEvent(float scale)
|
||||
{
|
||||
// update the icon size of the emote button
|
||||
QString text = "<img src=':/images/emote.svg' width='xD' height='xD' />";
|
||||
text.replace("xD", QString::number(int(12 * scale)));
|
||||
|
||||
this->ui_.emoteButton->getLabel().setText(text);
|
||||
this->ui_.emoteButton->setFixedHeight(int(18 * scale));
|
||||
this->updateEmoteButton();
|
||||
|
||||
// set maximum height
|
||||
this->setMaximumHeight(int(150 * this->getScale()));
|
||||
@@ -124,11 +120,29 @@ void SplitInput::themeRefreshEvent()
|
||||
|
||||
palette.setColor(QPalette::Foreground, this->themeManager->splits.input.text);
|
||||
|
||||
this->updateEmoteButton();
|
||||
this->ui_.textEditLength->setPalette(palette);
|
||||
|
||||
this->ui_.textEdit->setStyleSheet(this->themeManager->splits.input.styleSheet);
|
||||
|
||||
this->ui_.hbox->setMargin(int((this->themeManager->isLightTheme() ? 4 : 2) * this->getScale()));
|
||||
|
||||
this->ui_.emoteButton->getLabel().setStyleSheet("color: #000");
|
||||
}
|
||||
|
||||
void SplitInput::updateEmoteButton()
|
||||
{
|
||||
float scale = this->getScale();
|
||||
|
||||
QString text = "<img src=':/images/emote.svg' width='xD' height='xD' />";
|
||||
text.replace("xD", QString::number(int(12 * scale)));
|
||||
|
||||
if (this->themeManager->isLightTheme()) {
|
||||
text.replace("emote", "emote_dark");
|
||||
}
|
||||
|
||||
this->ui_.emoteButton->getLabel().setText(text);
|
||||
this->ui_.emoteButton->setFixedHeight(int(18 * scale));
|
||||
}
|
||||
|
||||
void SplitInput::installKeyPressedEvent()
|
||||
|
||||
@@ -33,6 +33,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void scaleChangedEvent(float scale) override;
|
||||
virtual void themeRefreshEvent() override;
|
||||
|
||||
virtual void paintEvent(QPaintEvent *) override;
|
||||
virtual void resizeEvent(QResizeEvent *) override;
|
||||
@@ -58,7 +59,8 @@ private:
|
||||
|
||||
void initLayout();
|
||||
void installKeyPressedEvent();
|
||||
virtual void themeRefreshEvent() override;
|
||||
|
||||
void updateEmoteButton();
|
||||
|
||||
private slots:
|
||||
void editTextChanged();
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "splitoverlay.hpp"
|
||||
|
||||
#include <QEvent>
|
||||
#include <QGraphicsBlurEffect>
|
||||
#include <QGraphicsEffect>
|
||||
#include <QGraphicsOpacityEffect>
|
||||
#include <QGridLayout>
|
||||
#include <QPainter>
|
||||
@@ -90,7 +92,11 @@ SplitOverlay::SplitOverlay(Split *parent)
|
||||
void SplitOverlay::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QPainter painter(this);
|
||||
painter.fillRect(this->rect(), QColor(0, 0, 0, 150));
|
||||
if (this->themeManager->isLightTheme()) {
|
||||
painter.fillRect(this->rect(), QColor(255, 255, 255, 200));
|
||||
} else {
|
||||
painter.fillRect(this->rect(), QColor(0, 0, 0, 150));
|
||||
}
|
||||
|
||||
QRect rect;
|
||||
switch (this->hoveredElement) {
|
||||
|
||||
Reference in New Issue
Block a user