mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Merge pull request #1017 from TranRed/nightly
Opening streams from toast + quickfix highlights in light theme
This commit is contained in:
commit
a5a0ad59b8
4 changed files with 64 additions and 8 deletions
|
@ -144,7 +144,7 @@ public:
|
|||
"/highlighting/whisperHighlight/enableSound", false};
|
||||
BoolSetting enableWhisperHighlightTaskbar = {
|
||||
"/highlighting/whisperHighlight/enableTaskbarFlashing", false};
|
||||
QStringSetting highlightColor = {"/highlighting/color", "#4B282C"};
|
||||
QStringSetting highlightColor = {"/highlighting/color", ""};
|
||||
|
||||
BoolSetting longAlerts = {"/highlighting/alerts", false};
|
||||
|
||||
|
@ -172,6 +172,7 @@ public:
|
|||
"qrc:/sounds/ping3.wav"};
|
||||
|
||||
BoolSetting notificationToast = {"/notifications/enableToast", false};
|
||||
QStringSetting openFromToast = {"/notifications/openFromToast", "in browser"};
|
||||
|
||||
/// External tools
|
||||
// Streamlink
|
||||
|
|
|
@ -38,6 +38,10 @@ void Theme::actuallyUpdate(double hue, double multiplier)
|
|||
|
||||
this->splits.resizeHandle = QColor(0, 148, 255, 0xff);
|
||||
this->splits.resizeHandleBackground = QColor(0, 148, 255, 0x50);
|
||||
|
||||
// Highlighted Messages: theme support quick-fix
|
||||
this->messages.backgrounds.highlighted =
|
||||
QColor("#BD8489");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -46,6 +50,11 @@ void Theme::actuallyUpdate(double hue, double multiplier)
|
|||
|
||||
this->splits.resizeHandle = QColor(0, 148, 255, 0x70);
|
||||
this->splits.resizeHandleBackground = QColor(0, 148, 255, 0x20);
|
||||
|
||||
// Highlighted Messages: theme support quick-fix
|
||||
this->messages.backgrounds.highlighted =
|
||||
QColor("#4B282C");
|
||||
|
||||
}
|
||||
|
||||
this->splits.header.background = getColor(0, sat, flat ? 1 : 0.9);
|
||||
|
@ -74,10 +83,15 @@ void Theme::actuallyUpdate(double hue, double multiplier)
|
|||
this->splits.dropPreviewBorder = QColor(0, 148, 255, 0xff);
|
||||
|
||||
// Highlighted Messages
|
||||
// hidden setting from PR #744 - if set it will overwrite theme color (for now!)
|
||||
//TODO: implement full theme support
|
||||
if (getSettings()->highlightColor != "") {
|
||||
this->messages.backgrounds.highlighted =
|
||||
QColor(getSettings()->highlightColor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Theme::normalizeColor(QColor &color)
|
||||
{
|
||||
if (this->isLightTheme())
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "providers/twitch/TwitchCommon.hpp"
|
||||
#include "providers/twitch/TwitchServer.hpp"
|
||||
#include "singletons/Paths.hpp"
|
||||
#include "util/StreamLink.hpp"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
||||
|
@ -85,13 +86,31 @@ public:
|
|||
}
|
||||
void toastActivated() const
|
||||
{
|
||||
QString openingMode = getSettings()->openFromToast;
|
||||
QString link;
|
||||
if (openingMode == "in browser")
|
||||
{
|
||||
if (platform_ == Platform::Twitch)
|
||||
{
|
||||
link = "http://www.twitch.tv/" + channelName_;
|
||||
}
|
||||
QDesktopServices::openUrl(QUrl(link));
|
||||
}
|
||||
else if (openingMode == "player in browser")
|
||||
{
|
||||
if (platform_ == Platform::Twitch)
|
||||
{
|
||||
link = "https://player.twitch.tv/?channel=" + channelName_;
|
||||
}
|
||||
QDesktopServices::openUrl(QUrl(link));
|
||||
}
|
||||
else if (openingMode == "in streamlink")
|
||||
{
|
||||
openStreamlinkForChannel(channelName_);
|
||||
}
|
||||
//the fourth and last option is "don't open"
|
||||
//in this case obviously nothing should happen
|
||||
}
|
||||
|
||||
void toastActivated(int actionIndex) const
|
||||
{
|
||||
|
@ -115,8 +134,14 @@ void Toasts::sendWindowsNotification(const QString &channelName, Platform p)
|
|||
std::wstring widestr = std::wstring(utf8_text.begin(), utf8_text.end());
|
||||
|
||||
templ.setTextField(widestr, WinToastLib::WinToastTemplate::FirstLine);
|
||||
templ.setTextField(L"Click here to open in browser",
|
||||
|
||||
if (getSettings()->openFromToast != "don't open") {
|
||||
QString mode = getSettings()->openFromToast ;
|
||||
|
||||
templ.setTextField(L"Click here to open " + mode.toStdWString(),
|
||||
WinToastLib::WinToastTemplate::SecondLine);
|
||||
}
|
||||
|
||||
QString Path;
|
||||
if (p == Platform::Twitch)
|
||||
{
|
||||
|
|
|
@ -17,6 +17,10 @@
|
|||
#include <QTableView>
|
||||
#include <QTimer>
|
||||
|
||||
|
||||
#define TOAST_REACTIONS \
|
||||
"in browser", "player in browser", "in streamlink", "don't open"
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
NotificationPage::NotificationPage()
|
||||
|
@ -39,6 +43,18 @@ NotificationPage::NotificationPage()
|
|||
settings.append(
|
||||
this->createCheckBox("Enable toasts (Windows 8 or later)",
|
||||
getSettings()->notificationToast));
|
||||
auto openIn =
|
||||
settings.emplace<QHBoxLayout>().withoutMargin();
|
||||
{
|
||||
openIn.emplace<QLabel>("Open stream from Toast: ")->setSizePolicy(
|
||||
QSizePolicy::Maximum, QSizePolicy::Preferred);
|
||||
openIn.append(
|
||||
this->createComboBox({TOAST_REACTIONS},
|
||||
getSettings()->openFromToast))->setSizePolicy(
|
||||
QSizePolicy::Maximum, QSizePolicy::Preferred);
|
||||
}
|
||||
openIn->setContentsMargins(40,0,0,0);
|
||||
openIn->setSizeConstraint(QLayout::SetMaximumSize);
|
||||
#endif
|
||||
auto customSound =
|
||||
layout.emplace<QHBoxLayout>().withoutMargin();
|
||||
|
|
Loading…
Reference in a new issue