Allow theming of tab live and rerun indicators (#5188)
This commit is contained in:
@@ -76,6 +76,8 @@ void parseTabs(const QJsonObject &tabs, chatterino::Theme &theme)
|
||||
}
|
||||
};
|
||||
parseColor(theme, tabs, dividerLine);
|
||||
parseColor(theme, tabs, liveIndicator);
|
||||
parseColor(theme, tabs, rerunIndicator);
|
||||
parseTabColors(tabs["regular"_L1].toObject(), theme.tabs.regular);
|
||||
parseTabColors(tabs["newMessage"_L1].toObject(), theme.tabs.newMessage);
|
||||
parseTabColors(tabs["highlighted"_L1].toObject(), theme.tabs.highlighted);
|
||||
|
||||
@@ -77,6 +77,9 @@ public:
|
||||
TabColors highlighted;
|
||||
TabColors selected;
|
||||
QColor dividerLine;
|
||||
|
||||
QColor liveIndicator;
|
||||
QColor rerunIndicator;
|
||||
} tabs;
|
||||
|
||||
/// MESSAGES
|
||||
|
||||
@@ -532,13 +532,13 @@ void NotebookTab::paintEvent(QPaintEvent *)
|
||||
QBrush b;
|
||||
if (this->isLive_)
|
||||
{
|
||||
painter.setPen(QColor(Qt::GlobalColor::red));
|
||||
b.setColor(QColor(Qt::GlobalColor::red));
|
||||
painter.setPen(this->theme->tabs.liveIndicator);
|
||||
b.setColor(this->theme->tabs.liveIndicator);
|
||||
}
|
||||
else
|
||||
{
|
||||
painter.setPen(QColor(Qt::GlobalColor::yellow));
|
||||
b.setColor(QColor(Qt::GlobalColor::yellow));
|
||||
painter.setPen(this->theme->tabs.rerunIndicator);
|
||||
b.setColor(this->theme->tabs.rerunIndicator);
|
||||
}
|
||||
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
|
||||
Reference in New Issue
Block a user