mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Tried chaning the color of the split when a channel is live
This commit is contained in:
parent
93bbe33664
commit
b671fc4133
7 changed files with 22 additions and 6 deletions
|
@ -18,6 +18,7 @@ enum class HighlightState {
|
|||
None,
|
||||
Highlighted,
|
||||
NewMessage,
|
||||
Notification,
|
||||
};
|
||||
|
||||
inline QString qS(const std::string &string)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "Application.hpp"
|
||||
#include "controllers/notifications/NotificationModel.hpp"
|
||||
#include "singletons/Toasts.hpp"
|
||||
|
||||
#include <wintoastlib.h>
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -326,6 +326,8 @@ void TwitchChannel::setLive(bool newLiveStatus)
|
|||
QApplication::alert(
|
||||
getApp()->windows->getMainWindow().window(), 2500);
|
||||
}
|
||||
this->tabHighlightRequested.invoke(
|
||||
HighlightState::Notification);
|
||||
}
|
||||
guard->live = newLiveStatus;
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@ public:
|
|||
pajlada::Signals::NoArgSignal liveStatusChanged;
|
||||
pajlada::Signals::NoArgSignal userStateChanged;
|
||||
pajlada::Signals::NoArgSignal roomModesChanged;
|
||||
pajlada::Signals::Signal<HighlightState> tabHighlightRequested;
|
||||
|
||||
private:
|
||||
struct NameOptions {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -49,6 +49,7 @@ public:
|
|||
TabColors newMessage;
|
||||
TabColors highlighted;
|
||||
TabColors selected;
|
||||
TabColors notified;
|
||||
QColor border;
|
||||
QColor bottomLine;
|
||||
} tabs;
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue