Merge pull request #1140 from TranRed/inlineWhisperHighlight

Added setting and functionality to highlight inline whispers
This commit is contained in:
pajlada
2019-07-14 19:32:09 +02:00
committed by GitHub
6 changed files with 21 additions and 8 deletions
+2 -1
View File
@@ -21,7 +21,8 @@ Message::~Message()
SBHighlight Message::getScrollBarHighlight() const
{
if (this->flags.has(MessageFlag::Highlighted))
if (this->flags.has(MessageFlag::Highlighted) ||
this->flags.has(MessageFlag::HighlightedWhisper))
{
return SBHighlight(SBHighlight::Highlight);
}
+2 -1
View File
@@ -30,7 +30,8 @@ enum class MessageFlag : uint32_t {
DoNotLog = (1 << 13),
AutoMod = (1 << 14),
RecentMessage = (1 << 15),
Whisper = (1 << 16)
Whisper = (1 << 16),
HighlightedWhisper = (1 << 17),
};
using MessageFlags = FlagsEnum<MessageFlag>;
+2 -1
View File
@@ -250,7 +250,8 @@ void MessageLayout::updateBuffer(QPixmap *buffer, int /*messageIndex*/,
// draw background
QColor backgroundColor = app->themes->messages.backgrounds.regular;
if (this->message_->flags.has(MessageFlag::Highlighted) &&
if ((this->message_->flags.has(MessageFlag::Highlighted) ||
this->message_->flags.has(MessageFlag::HighlightedWhisper)) &&
!this->flags.has(MessageLayoutFlag::IgnoreHighlights))
{
backgroundColor = app->themes->messages.backgrounds.highlighted;
@@ -184,6 +184,12 @@ MessagePtr TwitchMessageBuilder::build()
// highlights
this->parseHighlights(isPastMsg);
// highlighting incoming whispers if requested per setting
if (this->args.isReceivedWhisper && getSettings()->highlightInlineWhispers)
{
this->message().flags.set(MessageFlag::HighlightedWhisper, true);
}
// QString bits;
auto iterator = this->tags.find("bits");
if (iterator != this->tags.end())
+2
View File
@@ -160,6 +160,8 @@ public:
false};
BoolSetting inlineWhispers = {"/whispers/enableInlineWhispers", true};
BoolSetting highlightInlineWhispers = {"/whispers/highlightInlineWhispers",
false};
/// Notifications
BoolSetting notificationFlashTaskbar = {"/notifications/enableFlashTaskbar",
+7 -5
View File
@@ -271,17 +271,19 @@ void GeneralPage::initLayout(SettingsLayout &layout)
layout.addCheckbox("Double click links to open", s.linksDoubleClickOnly);
layout.addCheckbox("Unshorten links", s.unshortLinks);
layout.addCheckbox("Show live indicator in tabs", s.showTabLive);
layout.addDropdown<int>(
"Show emote preview in tooltip on hover",
{"Don't show", "Always show", "Hold shift"}, s.emotesTooltipPreview,
[](int index) { return index; }, [](auto args) { return args.index; },
false);
layout.addDropdown<int>("Show emote preview in tooltip on hover",
{"Don't show", "Always show", "Hold shift"},
s.emotesTooltipPreview,
[](int index) { return index; },
[](auto args) { return args.index; }, false);
layout.addSpacing(16);
layout.addSeperator();
layout.addTitle2("Miscellaneous (Twitch)");
layout.addCheckbox("Show twitch whispers inline", s.inlineWhispers);
layout.addCheckbox("Highlight received inline whispers",
s.highlightInlineWhispers);
layout.addCheckbox("Load message history on connect",
s.loadTwitchMessageHistoryOnConnect);