diff --git a/src/common/Common.hpp b/src/common/Common.hpp index 251727c24..180dfb6a3 100644 --- a/src/common/Common.hpp +++ b/src/common/Common.hpp @@ -18,6 +18,7 @@ enum class HighlightState { None, Highlighted, NewMessage, + Notification, }; inline QString qS(const std::string &string) diff --git a/src/controllers/notifications/NotificationController.cpp b/src/controllers/notifications/NotificationController.cpp index 92272f978..d07b3a794 100644 --- a/src/controllers/notifications/NotificationController.cpp +++ b/src/controllers/notifications/NotificationController.cpp @@ -2,6 +2,7 @@ #include "Application.hpp" #include "controllers/notifications/NotificationModel.hpp" +#include "singletons/Toasts.hpp" #include @@ -73,7 +74,7 @@ void NotificationController::removeChannelNotification( } } } - +/////////////////////////////////////////////////// void NotificationController::playSound() { static auto player = new QMediaPlayer; @@ -93,7 +94,7 @@ void NotificationController::playSound() } player->play(); } - +/////////////////////////////////////////////////// NotificationModel *NotificationController::createModel(QObject *parent, Platform p) { diff --git a/src/providers/twitch/TwitchChannel.cpp b/src/providers/twitch/TwitchChannel.cpp index 864fba437..dcc083161 100644 --- a/src/providers/twitch/TwitchChannel.cpp +++ b/src/providers/twitch/TwitchChannel.cpp @@ -326,6 +326,8 @@ void TwitchChannel::setLive(bool newLiveStatus) QApplication::alert( getApp()->windows->getMainWindow().window(), 2500); } + this->tabHighlightRequested.invoke( + HighlightState::Notification); } guard->live = newLiveStatus; } diff --git a/src/providers/twitch/TwitchChannel.hpp b/src/providers/twitch/TwitchChannel.hpp index bc084d73f..ec690aefd 100644 --- a/src/providers/twitch/TwitchChannel.hpp +++ b/src/providers/twitch/TwitchChannel.hpp @@ -86,6 +86,7 @@ public: pajlada::Signals::NoArgSignal liveStatusChanged; pajlada::Signals::NoArgSignal userStateChanged; pajlada::Signals::NoArgSignal roomModesChanged; + pajlada::Signals::Signal tabHighlightRequested; private: struct NameOptions { diff --git a/src/singletons/Theme.cpp b/src/singletons/Theme.cpp index c5aa16b71..eb20a7647 100644 --- a/src/singletons/Theme.cpp +++ b/src/singletons/Theme.cpp @@ -105,6 +105,10 @@ void Theme::actuallyUpdate(double hue, double multiplier) QColor("#000"), {QColor("#b4d7ff"), QColor("#b4d7ff"), QColor("#b4d7ff")}, {QColor("#00aeef"), QColor("#00aeef"), QColor("#00aeef")}}; + this->tabs.notified = { + fg, + {QColor("#252525"), QColor("#252525"), QColor("#252525")}, + {QColor("#F824A8"), QColor("#F824A8"), QColor("#F824A8")}}; } else { this->tabs.regular = { QColor("#aaa"), @@ -123,6 +127,10 @@ void Theme::actuallyUpdate(double hue, double multiplier) QColor("#fff"), {QColor("#555555"), QColor("#555555"), QColor("#555555")}, {QColor("#00aeef"), QColor("#00aeef"), QColor("#00aeef")}}; + this->tabs.notified = { + fg, + {QColor("#252525"), QColor("#252525"), QColor("#252525")}, + {QColor("#F824A8"), QColor("#F824A8"), QColor("#F824A8")}}; } this->splits.input.focusedLine = highlighted; @@ -150,7 +158,7 @@ void Theme::actuallyUpdate(double hue, double multiplier) // QColor("#777"), QColor("#666")}}; this->tabs.bottomLine = this->tabs.selected.backgrounds.regular.color(); - } + } // namespace chatterino // Split bool flat = isLight_; @@ -232,7 +240,7 @@ void Theme::actuallyUpdate(double hue, double multiplier) isLightTheme() ? QColor(0, 0, 0, 64) : QColor(255, 255, 255, 64); this->updated.invoke(); -} +} // namespace chatterino QColor Theme::blendColors(const QColor &color1, const QColor &color2, qreal ratio) diff --git a/src/singletons/Theme.hpp b/src/singletons/Theme.hpp index 47bb6c3ef..66b859aaa 100644 --- a/src/singletons/Theme.hpp +++ b/src/singletons/Theme.hpp @@ -49,6 +49,7 @@ public: TabColors newMessage; TabColors highlighted; TabColors selected; + TabColors notified; QColor border; QColor bottomLine; } tabs; diff --git a/src/widgets/helper/NotebookTab.cpp b/src/widgets/helper/NotebookTab.cpp index c9c55ff2c..0e9a97662 100644 --- a/src/widgets/helper/NotebookTab.cpp +++ b/src/widgets/helper/NotebookTab.cpp @@ -169,8 +169,8 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle) if (this->isSelected()) { return; } - - if (this->highlightState_ != HighlightState::Highlighted) { + if (this->highlightState_ != HighlightState::Highlighted && + this->highlightState_ != HighlightState::Notification) { this->highlightState_ = newHighlightStyle; this->update(); @@ -237,6 +237,8 @@ void NotebookTab::paintEvent(QPaintEvent *) colors = this->theme->tabs.selected; } else if (this->highlightState_ == HighlightState::Highlighted) { colors = this->theme->tabs.highlighted; + } else if (this->highlightState_ == HighlightState::Notification) { + colors = this->theme->tabs.notified; } else if (this->highlightState_ == HighlightState::NewMessage) { colors = this->theme->tabs.newMessage; } else {