Allow theming of tab live and rerun indicators (#5188)

This commit is contained in:
Mm2PL 2024-02-24 13:26:49 +01:00 committed by GitHub
parent dd61482046
commit df2b5f94f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 20 additions and 4 deletions

View file

@ -34,6 +34,7 @@
- Minor: Added the ability to change the top-most status of a window regardless of the _Always on top_ setting (right click the notebook). (#5135)
- Minor: Live streams that are marked as reruns now mark a tab as yellow instead of red. (#5176)
- Minor: Updated to Emoji v15.1. Google emojis are now used as the fallback instead of Twitter emojis. (#5182)
- Minor: Allow theming of tab live and rerun indicators. (#5188)
- Bugfix: Fixed an issue where certain emojis did not send to Twitch chat correctly. (#4840)
- Bugfix: Fixed capitalized channel names in log inclusion list not being logged. (#4848)
- Bugfix: Trimmed custom streamlink paths on all platforms making sure you don't accidentally add spaces at the beginning or end of its path. (#4834)

View file

@ -339,6 +339,8 @@
"type": "object",
"additionalProperties": false,
"properties": {
"liveIndicator": { "$ref": "#/definitions/qt-color" },
"rerunIndicator": { "$ref": "#/definitions/qt-color" },
"dividerLine": { "$ref": "#/definitions/qt-color" },
"highlighted": {
"$ref": "#/definitions/tab-colors"

View file

@ -50,6 +50,8 @@
"resizeHandleBackground": "#200094ff"
},
"tabs": {
"liveIndicator": "#ff0000",
"rerunIndicator": "#c7c715",
"dividerLine": "#555555",
"highlighted": {
"backgrounds": {

View file

@ -50,6 +50,8 @@
"resizeHandleBackground": "#200094ff"
},
"tabs": {
"liveIndicator": "#ff0000",
"rerunIndicator": "#c7c715",
"dividerLine": "#555555",
"highlighted": {
"backgrounds": {

View file

@ -50,6 +50,8 @@
"resizeHandleBackground": "#500094ff"
},
"tabs": {
"liveIndicator": "#ff0000",
"rerunIndicator": "#c7c715",
"dividerLine": "#b4d7ff",
"highlighted": {
"backgrounds": {

View file

@ -50,6 +50,8 @@
"resizeHandleBackground": "#500094ff"
},
"tabs": {
"liveIndicator": "#ff0000",
"rerunIndicator": "#c7c715",
"dividerLine": "#b4d7ff",
"highlighted": {
"backgrounds": {

View file

@ -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);

View file

@ -77,6 +77,9 @@ public:
TabColors highlighted;
TabColors selected;
QColor dividerLine;
QColor liveIndicator;
QColor rerunIndicator;
} tabs;
/// MESSAGES

View file

@ -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);