mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Merge pull request #1140 from TranRed/inlineWhisperHighlight
Added setting and functionality to highlight inline whispers
This commit is contained in:
commit
fb6a55847d
|
@ -21,7 +21,8 @@ Message::~Message()
|
||||||
|
|
||||||
SBHighlight Message::getScrollBarHighlight() const
|
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);
|
return SBHighlight(SBHighlight::Highlight);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,8 @@ enum class MessageFlag : uint32_t {
|
||||||
DoNotLog = (1 << 13),
|
DoNotLog = (1 << 13),
|
||||||
AutoMod = (1 << 14),
|
AutoMod = (1 << 14),
|
||||||
RecentMessage = (1 << 15),
|
RecentMessage = (1 << 15),
|
||||||
Whisper = (1 << 16)
|
Whisper = (1 << 16),
|
||||||
|
HighlightedWhisper = (1 << 17),
|
||||||
};
|
};
|
||||||
using MessageFlags = FlagsEnum<MessageFlag>;
|
using MessageFlags = FlagsEnum<MessageFlag>;
|
||||||
|
|
||||||
|
|
|
@ -250,7 +250,8 @@ void MessageLayout::updateBuffer(QPixmap *buffer, int /*messageIndex*/,
|
||||||
|
|
||||||
// draw background
|
// draw background
|
||||||
QColor backgroundColor = app->themes->messages.backgrounds.regular;
|
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))
|
!this->flags.has(MessageLayoutFlag::IgnoreHighlights))
|
||||||
{
|
{
|
||||||
backgroundColor = app->themes->messages.backgrounds.highlighted;
|
backgroundColor = app->themes->messages.backgrounds.highlighted;
|
||||||
|
|
|
@ -184,6 +184,12 @@ MessagePtr TwitchMessageBuilder::build()
|
||||||
// highlights
|
// highlights
|
||||||
this->parseHighlights(isPastMsg);
|
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;
|
// QString bits;
|
||||||
auto iterator = this->tags.find("bits");
|
auto iterator = this->tags.find("bits");
|
||||||
if (iterator != this->tags.end())
|
if (iterator != this->tags.end())
|
||||||
|
|
|
@ -160,6 +160,8 @@ public:
|
||||||
false};
|
false};
|
||||||
|
|
||||||
BoolSetting inlineWhispers = {"/whispers/enableInlineWhispers", true};
|
BoolSetting inlineWhispers = {"/whispers/enableInlineWhispers", true};
|
||||||
|
BoolSetting highlightInlineWhispers = {"/whispers/highlightInlineWhispers",
|
||||||
|
false};
|
||||||
|
|
||||||
/// Notifications
|
/// Notifications
|
||||||
BoolSetting notificationFlashTaskbar = {"/notifications/enableFlashTaskbar",
|
BoolSetting notificationFlashTaskbar = {"/notifications/enableFlashTaskbar",
|
||||||
|
|
|
@ -271,17 +271,19 @@ void GeneralPage::initLayout(SettingsLayout &layout)
|
||||||
layout.addCheckbox("Double click links to open", s.linksDoubleClickOnly);
|
layout.addCheckbox("Double click links to open", s.linksDoubleClickOnly);
|
||||||
layout.addCheckbox("Unshorten links", s.unshortLinks);
|
layout.addCheckbox("Unshorten links", s.unshortLinks);
|
||||||
layout.addCheckbox("Show live indicator in tabs", s.showTabLive);
|
layout.addCheckbox("Show live indicator in tabs", s.showTabLive);
|
||||||
layout.addDropdown<int>(
|
layout.addDropdown<int>("Show emote preview in tooltip on hover",
|
||||||
"Show emote preview in tooltip on hover",
|
{"Don't show", "Always show", "Hold shift"},
|
||||||
{"Don't show", "Always show", "Hold shift"}, s.emotesTooltipPreview,
|
s.emotesTooltipPreview,
|
||||||
[](int index) { return index; }, [](auto args) { return args.index; },
|
[](int index) { return index; },
|
||||||
false);
|
[](auto args) { return args.index; }, false);
|
||||||
|
|
||||||
layout.addSpacing(16);
|
layout.addSpacing(16);
|
||||||
layout.addSeperator();
|
layout.addSeperator();
|
||||||
|
|
||||||
layout.addTitle2("Miscellaneous (Twitch)");
|
layout.addTitle2("Miscellaneous (Twitch)");
|
||||||
layout.addCheckbox("Show twitch whispers inline", s.inlineWhispers);
|
layout.addCheckbox("Show twitch whispers inline", s.inlineWhispers);
|
||||||
|
layout.addCheckbox("Highlight received inline whispers",
|
||||||
|
s.highlightInlineWhispers);
|
||||||
layout.addCheckbox("Load message history on connect",
|
layout.addCheckbox("Load message history on connect",
|
||||||
s.loadTwitchMessageHistoryOnConnect);
|
s.loadTwitchMessageHistoryOnConnect);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue