Skip to content

Commit df2b5f9

Browse files
authored
Allow theming of tab live and rerun indicators (#5188)
1 parent dd61482 commit df2b5f9

File tree

9 files changed

+20
-4
lines changed

9 files changed

+20
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
- 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)
3535
- Minor: Live streams that are marked as reruns now mark a tab as yellow instead of red. (#5176)
3636
- Minor: Updated to Emoji v15.1. Google emojis are now used as the fallback instead of Twitter emojis. (#5182)
37+
- Minor: Allow theming of tab live and rerun indicators. (#5188)
3738
- Bugfix: Fixed an issue where certain emojis did not send to Twitch chat correctly. (#4840)
3839
- Bugfix: Fixed capitalized channel names in log inclusion list not being logged. (#4848)
3940
- 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)

docs/ChatterinoTheme.schema.json

+2
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,8 @@
339339
"type": "object",
340340
"additionalProperties": false,
341341
"properties": {
342+
"liveIndicator": { "$ref": "#/definitions/qt-color" },
343+
"rerunIndicator": { "$ref": "#/definitions/qt-color" },
342344
"dividerLine": { "$ref": "#/definitions/qt-color" },
343345
"highlighted": {
344346
"$ref": "#/definitions/tab-colors"

resources/themes/Black.json

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
"resizeHandleBackground": "#200094ff"
5151
},
5252
"tabs": {
53+
"liveIndicator": "#ff0000",
54+
"rerunIndicator": "#c7c715",
5355
"dividerLine": "#555555",
5456
"highlighted": {
5557
"backgrounds": {

resources/themes/Dark.json

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
"resizeHandleBackground": "#200094ff"
5151
},
5252
"tabs": {
53+
"liveIndicator": "#ff0000",
54+
"rerunIndicator": "#c7c715",
5355
"dividerLine": "#555555",
5456
"highlighted": {
5557
"backgrounds": {

resources/themes/Light.json

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
"resizeHandleBackground": "#500094ff"
5151
},
5252
"tabs": {
53+
"liveIndicator": "#ff0000",
54+
"rerunIndicator": "#c7c715",
5355
"dividerLine": "#b4d7ff",
5456
"highlighted": {
5557
"backgrounds": {

resources/themes/White.json

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
"resizeHandleBackground": "#500094ff"
5151
},
5252
"tabs": {
53+
"liveIndicator": "#ff0000",
54+
"rerunIndicator": "#c7c715",
5355
"dividerLine": "#b4d7ff",
5456
"highlighted": {
5557
"backgrounds": {

src/singletons/Theme.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ void parseTabs(const QJsonObject &tabs, chatterino::Theme &theme)
7676
}
7777
};
7878
parseColor(theme, tabs, dividerLine);
79+
parseColor(theme, tabs, liveIndicator);
80+
parseColor(theme, tabs, rerunIndicator);
7981
parseTabColors(tabs["regular"_L1].toObject(), theme.tabs.regular);
8082
parseTabColors(tabs["newMessage"_L1].toObject(), theme.tabs.newMessage);
8183
parseTabColors(tabs["highlighted"_L1].toObject(), theme.tabs.highlighted);

src/singletons/Theme.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ class Theme final : public Singleton
7777
TabColors highlighted;
7878
TabColors selected;
7979
QColor dividerLine;
80+
81+
QColor liveIndicator;
82+
QColor rerunIndicator;
8083
} tabs;
8184

8285
/// MESSAGES

src/widgets/helper/NotebookTab.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -532,13 +532,13 @@ void NotebookTab::paintEvent(QPaintEvent *)
532532
QBrush b;
533533
if (this->isLive_)
534534
{
535-
painter.setPen(QColor(Qt::GlobalColor::red));
536-
b.setColor(QColor(Qt::GlobalColor::red));
535+
painter.setPen(this->theme->tabs.liveIndicator);
536+
b.setColor(this->theme->tabs.liveIndicator);
537537
}
538538
else
539539
{
540-
painter.setPen(QColor(Qt::GlobalColor::yellow));
541-
b.setColor(QColor(Qt::GlobalColor::yellow));
540+
painter.setPen(this->theme->tabs.rerunIndicator);
541+
b.setColor(this->theme->tabs.rerunIndicator);
542542
}
543543

544544
painter.setRenderHint(QPainter::Antialiasing);

0 commit comments

Comments
 (0)