mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Historic messages behaviour
"Crossed and Greyed" -> default (and is current default) "Crossed" -> just crossed "Greyed" -> just greyed "No change" -> no change in appearance
This commit is contained in:
parent
498fb3717e
commit
441f6189a1
6 changed files with 39 additions and 8 deletions
|
@ -29,6 +29,7 @@ enum class MessageFlag : uint16_t {
|
||||||
Subscription = (1 << 12),
|
Subscription = (1 << 12),
|
||||||
Notification = (1 << 13),
|
Notification = (1 << 13),
|
||||||
AutoMod = (1 << 14),
|
AutoMod = (1 << 14),
|
||||||
|
RecentMessage = (1 << 15),
|
||||||
};
|
};
|
||||||
using MessageFlags = FlagsEnum<MessageFlag>;
|
using MessageFlags = FlagsEnum<MessageFlag>;
|
||||||
|
|
||||||
|
|
|
@ -205,6 +205,32 @@ void MessageLayout::paint(QPainter &painter, int width, int y, int messageIndex,
|
||||||
// app->themes->messages.disabled);
|
// app->themes->messages.disabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this->message_->flags.has(MessageFlag::RecentMessage))
|
||||||
|
{
|
||||||
|
const auto &setting =
|
||||||
|
getSettings()->historicMessagesAppearance.getValue();
|
||||||
|
/// hemirt: for options check the options associated with the setting
|
||||||
|
/// historicMessagesAppearance in GeneralPage.cpp (and default in
|
||||||
|
/// Settings.hpp)
|
||||||
|
if (setting == "Crossed and Greyed")
|
||||||
|
{
|
||||||
|
painter.fillRect(0, y, pixmap->width(), pixmap->height(),
|
||||||
|
QBrush(QColor(255, 0, 0, 63), Qt::BDiagPattern));
|
||||||
|
painter.fillRect(0, y, pixmap->width(), pixmap->height(),
|
||||||
|
app->themes->messages.disabled);
|
||||||
|
}
|
||||||
|
else if (setting == "Crossed")
|
||||||
|
{
|
||||||
|
painter.fillRect(0, y, pixmap->width(), pixmap->height(),
|
||||||
|
QBrush(QColor(255, 0, 0, 63), Qt::BDiagPattern));
|
||||||
|
}
|
||||||
|
else if (setting == "Greyed")
|
||||||
|
{
|
||||||
|
painter.fillRect(0, y, pixmap->width(), pixmap->height(),
|
||||||
|
app->themes->messages.disabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// draw selection
|
// draw selection
|
||||||
if (!selection.isEmpty())
|
if (!selection.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,8 +48,7 @@ namespace {
|
||||||
|
|
||||||
MessageParseArgs args;
|
MessageParseArgs args;
|
||||||
TwitchMessageBuilder builder(channel.get(), privMsg, args);
|
TwitchMessageBuilder builder(channel.get(), privMsg, args);
|
||||||
if (getSettings()->greyOutHistoricMessages)
|
builder.message().flags.set(MessageFlag::RecentMessage);
|
||||||
builder.message().flags.set(MessageFlag::Disabled);
|
|
||||||
|
|
||||||
if (!builder.isIgnored())
|
if (!builder.isIgnored())
|
||||||
messages.push_back(builder.build());
|
messages.push_back(builder.build());
|
||||||
|
|
|
@ -31,8 +31,9 @@ public:
|
||||||
Qt::VerPattern};
|
Qt::VerPattern};
|
||||||
QStringSetting lastMessageColor = {"/appearance/messages/lastMessageColor",
|
QStringSetting lastMessageColor = {"/appearance/messages/lastMessageColor",
|
||||||
""};
|
""};
|
||||||
BoolSetting greyOutHistoricMessages = {
|
QStringSetting historicMessagesAppearance = {
|
||||||
"/appearance/messages/greyOutHistoricMessages", true};
|
"/appearance/messages/historicMessagesAppearance",
|
||||||
|
"Crossed and Greyed"};
|
||||||
BoolSetting showEmptyInput = {"/appearance/showEmptyInputBox", true};
|
BoolSetting showEmptyInput = {"/appearance/showEmptyInputBox", true};
|
||||||
BoolSetting showMessageLength = {"/appearance/messages/showMessageLength",
|
BoolSetting showMessageLength = {"/appearance/messages/showMessageLength",
|
||||||
false};
|
false};
|
||||||
|
|
|
@ -263,7 +263,9 @@ void GeneralPage::initLayout(SettingsLayout &layout)
|
||||||
|
|
||||||
layout.addTitle2("Misc");
|
layout.addTitle2("Misc");
|
||||||
layout.addCheckbox("Show twitch whispers inline", s.inlineWhispers);
|
layout.addCheckbox("Show twitch whispers inline", s.inlineWhispers);
|
||||||
layout.addCheckbox("Grey out historic messages", s.greyOutHistoricMessages);
|
layout.addDropdown("Historic messages appearance",
|
||||||
|
{"Crossed and Greyed", "Crossed", "Greyed", "No change"},
|
||||||
|
s.historicMessagesAppearance);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
layout.addTitle2("Cache");
|
layout.addTitle2("Cache");
|
||||||
|
|
|
@ -182,9 +182,11 @@ void LookPage::addMessageTab(LayoutCreator<QVBoxLayout> layout)
|
||||||
|
|
||||||
layout.append(
|
layout.append(
|
||||||
this->createCheckBox("Compact emotes", getSettings()->compactEmotes));
|
this->createCheckBox("Compact emotes", getSettings()->compactEmotes));
|
||||||
|
/// greyOutHistoricMessages setting changed by hemirt from checkbox to
|
||||||
layout.append(this->createCheckBox("Grey out historic messages",
|
/// historicMessagesBehaviour dropdown QString option
|
||||||
getSettings()->greyOutHistoricMessages));
|
// layout.append(this->createCheckBox("Grey out historic messages",
|
||||||
|
// getSettings()->greyOutHistoricMessages));
|
||||||
|
///
|
||||||
// --
|
// --
|
||||||
layout.emplace<Line>(false);
|
layout.emplace<Line>(false);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue