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,
|
None,
|
||||||
Highlighted,
|
Highlighted,
|
||||||
NewMessage,
|
NewMessage,
|
||||||
|
Notification,
|
||||||
};
|
};
|
||||||
|
|
||||||
inline QString qS(const std::string &string)
|
inline QString qS(const std::string &string)
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "Application.hpp"
|
#include "Application.hpp"
|
||||||
#include "controllers/notifications/NotificationModel.hpp"
|
#include "controllers/notifications/NotificationModel.hpp"
|
||||||
|
#include "singletons/Toasts.hpp"
|
||||||
|
|
||||||
#include <wintoastlib.h>
|
#include <wintoastlib.h>
|
||||||
|
|
||||||
|
@ -73,7 +74,7 @@ void NotificationController::removeChannelNotification(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
///////////////////////////////////////////////////
|
||||||
void NotificationController::playSound()
|
void NotificationController::playSound()
|
||||||
{
|
{
|
||||||
static auto player = new QMediaPlayer;
|
static auto player = new QMediaPlayer;
|
||||||
|
@ -93,7 +94,7 @@ void NotificationController::playSound()
|
||||||
}
|
}
|
||||||
player->play();
|
player->play();
|
||||||
}
|
}
|
||||||
|
///////////////////////////////////////////////////
|
||||||
NotificationModel *NotificationController::createModel(QObject *parent,
|
NotificationModel *NotificationController::createModel(QObject *parent,
|
||||||
Platform p)
|
Platform p)
|
||||||
{
|
{
|
||||||
|
|
|
@ -326,6 +326,8 @@ void TwitchChannel::setLive(bool newLiveStatus)
|
||||||
QApplication::alert(
|
QApplication::alert(
|
||||||
getApp()->windows->getMainWindow().window(), 2500);
|
getApp()->windows->getMainWindow().window(), 2500);
|
||||||
}
|
}
|
||||||
|
this->tabHighlightRequested.invoke(
|
||||||
|
HighlightState::Notification);
|
||||||
}
|
}
|
||||||
guard->live = newLiveStatus;
|
guard->live = newLiveStatus;
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,6 +86,7 @@ public:
|
||||||
pajlada::Signals::NoArgSignal liveStatusChanged;
|
pajlada::Signals::NoArgSignal liveStatusChanged;
|
||||||
pajlada::Signals::NoArgSignal userStateChanged;
|
pajlada::Signals::NoArgSignal userStateChanged;
|
||||||
pajlada::Signals::NoArgSignal roomModesChanged;
|
pajlada::Signals::NoArgSignal roomModesChanged;
|
||||||
|
pajlada::Signals::Signal<HighlightState> tabHighlightRequested;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct NameOptions {
|
struct NameOptions {
|
||||||
|
|
|
@ -105,6 +105,10 @@ void Theme::actuallyUpdate(double hue, double multiplier)
|
||||||
QColor("#000"),
|
QColor("#000"),
|
||||||
{QColor("#b4d7ff"), QColor("#b4d7ff"), QColor("#b4d7ff")},
|
{QColor("#b4d7ff"), QColor("#b4d7ff"), QColor("#b4d7ff")},
|
||||||
{QColor("#00aeef"), QColor("#00aeef"), QColor("#00aeef")}};
|
{QColor("#00aeef"), QColor("#00aeef"), QColor("#00aeef")}};
|
||||||
|
this->tabs.notified = {
|
||||||
|
fg,
|
||||||
|
{QColor("#252525"), QColor("#252525"), QColor("#252525")},
|
||||||
|
{QColor("#F824A8"), QColor("#F824A8"), QColor("#F824A8")}};
|
||||||
} else {
|
} else {
|
||||||
this->tabs.regular = {
|
this->tabs.regular = {
|
||||||
QColor("#aaa"),
|
QColor("#aaa"),
|
||||||
|
@ -123,6 +127,10 @@ void Theme::actuallyUpdate(double hue, double multiplier)
|
||||||
QColor("#fff"),
|
QColor("#fff"),
|
||||||
{QColor("#555555"), QColor("#555555"), QColor("#555555")},
|
{QColor("#555555"), QColor("#555555"), QColor("#555555")},
|
||||||
{QColor("#00aeef"), QColor("#00aeef"), QColor("#00aeef")}};
|
{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;
|
this->splits.input.focusedLine = highlighted;
|
||||||
|
@ -150,7 +158,7 @@ void Theme::actuallyUpdate(double hue, double multiplier)
|
||||||
// QColor("#777"), QColor("#666")}};
|
// QColor("#777"), QColor("#666")}};
|
||||||
|
|
||||||
this->tabs.bottomLine = this->tabs.selected.backgrounds.regular.color();
|
this->tabs.bottomLine = this->tabs.selected.backgrounds.regular.color();
|
||||||
}
|
} // namespace chatterino
|
||||||
|
|
||||||
// Split
|
// Split
|
||||||
bool flat = isLight_;
|
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);
|
isLightTheme() ? QColor(0, 0, 0, 64) : QColor(255, 255, 255, 64);
|
||||||
|
|
||||||
this->updated.invoke();
|
this->updated.invoke();
|
||||||
}
|
} // namespace chatterino
|
||||||
|
|
||||||
QColor Theme::blendColors(const QColor &color1, const QColor &color2,
|
QColor Theme::blendColors(const QColor &color1, const QColor &color2,
|
||||||
qreal ratio)
|
qreal ratio)
|
||||||
|
|
|
@ -49,6 +49,7 @@ public:
|
||||||
TabColors newMessage;
|
TabColors newMessage;
|
||||||
TabColors highlighted;
|
TabColors highlighted;
|
||||||
TabColors selected;
|
TabColors selected;
|
||||||
|
TabColors notified;
|
||||||
QColor border;
|
QColor border;
|
||||||
QColor bottomLine;
|
QColor bottomLine;
|
||||||
} tabs;
|
} tabs;
|
||||||
|
|
|
@ -169,8 +169,8 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle)
|
||||||
if (this->isSelected()) {
|
if (this->isSelected()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (this->highlightState_ != HighlightState::Highlighted &&
|
||||||
if (this->highlightState_ != HighlightState::Highlighted) {
|
this->highlightState_ != HighlightState::Notification) {
|
||||||
this->highlightState_ = newHighlightStyle;
|
this->highlightState_ = newHighlightStyle;
|
||||||
|
|
||||||
this->update();
|
this->update();
|
||||||
|
@ -237,6 +237,8 @@ void NotebookTab::paintEvent(QPaintEvent *)
|
||||||
colors = this->theme->tabs.selected;
|
colors = this->theme->tabs.selected;
|
||||||
} else if (this->highlightState_ == HighlightState::Highlighted) {
|
} else if (this->highlightState_ == HighlightState::Highlighted) {
|
||||||
colors = this->theme->tabs.highlighted;
|
colors = this->theme->tabs.highlighted;
|
||||||
|
} else if (this->highlightState_ == HighlightState::Notification) {
|
||||||
|
colors = this->theme->tabs.notified;
|
||||||
} else if (this->highlightState_ == HighlightState::NewMessage) {
|
} else if (this->highlightState_ == HighlightState::NewMessage) {
|
||||||
colors = this->theme->tabs.newMessage;
|
colors = this->theme->tabs.newMessage;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue