mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
commit
bfa002d3a1
8 changed files with 82 additions and 9 deletions
|
@ -385,6 +385,7 @@ HEADERS += \
|
||||||
src/widgets/splits/ClosedSplits.hpp \
|
src/widgets/splits/ClosedSplits.hpp \
|
||||||
src/providers/ffz/FfzModBadge.hpp \
|
src/providers/ffz/FfzModBadge.hpp \
|
||||||
src/widgets/settingspages/GeneralPage.hpp \
|
src/widgets/settingspages/GeneralPage.hpp \
|
||||||
|
src/messages/HistoricMessageAppearance.hpp
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
resources/resources.qrc \
|
resources/resources.qrc \
|
||||||
|
|
10
src/messages/HistoricMessageAppearance.hpp
Normal file
10
src/messages/HistoricMessageAppearance.hpp
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace chatterino {
|
||||||
|
|
||||||
|
enum HistoricMessageAppearance {
|
||||||
|
Crossed = (1 << 0),
|
||||||
|
Greyed = (1 << 1),
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace chatterino
|
|
@ -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>;
|
||||||
|
|
||||||
|
|
|
@ -209,6 +209,22 @@ void MessageLayout::paint(QPainter &painter, int width, int y, int messageIndex,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this->message_->flags.has(MessageFlag::RecentMessage))
|
||||||
|
{
|
||||||
|
const auto &historicMessageAppearance =
|
||||||
|
getSettings()->historicMessagesAppearance.getValue();
|
||||||
|
if (historicMessageAppearance & HistoricMessageAppearance::Crossed)
|
||||||
|
{
|
||||||
|
painter.fillRect(0, y, pixmap->width(), pixmap->height(),
|
||||||
|
QBrush(QColor(255, 0, 0, 63), Qt::BDiagPattern));
|
||||||
|
}
|
||||||
|
if (historicMessageAppearance & HistoricMessageAppearance::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());
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include "controllers/highlights/HighlightPhrase.hpp"
|
#include "controllers/highlights/HighlightPhrase.hpp"
|
||||||
#include "controllers/moderationactions/ModerationAction.hpp"
|
#include "controllers/moderationactions/ModerationAction.hpp"
|
||||||
|
#include "messages/HistoricMessageAppearance.hpp"
|
||||||
|
|
||||||
#include <pajlada/settings/setting.hpp>
|
#include <pajlada/settings/setting.hpp>
|
||||||
#include <pajlada/settings/settinglistener.hpp>
|
#include <pajlada/settings/settinglistener.hpp>
|
||||||
|
@ -31,8 +32,9 @@ public:
|
||||||
Qt::VerPattern};
|
Qt::VerPattern};
|
||||||
QStringSetting lastMessageColor = {"/appearance/messages/lastMessageColor",
|
QStringSetting lastMessageColor = {"/appearance/messages/lastMessageColor",
|
||||||
""};
|
""};
|
||||||
BoolSetting greyOutHistoricMessages = {
|
IntSetting historicMessagesAppearance = {
|
||||||
"/appearance/messages/greyOutHistoricMessages", true};
|
"/appearance/messages/historicMessagesAppearance",
|
||||||
|
HistoricMessageAppearance::Crossed | HistoricMessageAppearance::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,49 @@ 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<int>(
|
||||||
|
"Historic messages appearance",
|
||||||
|
{"Crossed and Greyed", "Crossed", "Greyed", "No change"},
|
||||||
|
s.historicMessagesAppearance,
|
||||||
|
[](auto val) {
|
||||||
|
if (val & HistoricMessageAppearance::Crossed &&
|
||||||
|
val & HistoricMessageAppearance::Greyed)
|
||||||
|
{
|
||||||
|
return QString("Crossed and Greyed");
|
||||||
|
}
|
||||||
|
else if (val & HistoricMessageAppearance::Crossed)
|
||||||
|
{
|
||||||
|
return QString("Crossed");
|
||||||
|
}
|
||||||
|
else if (val & HistoricMessageAppearance::Greyed)
|
||||||
|
{
|
||||||
|
return QString("Greyed");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return QString("No Change");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[](auto args) -> int {
|
||||||
|
switch (args.index)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
case 0:
|
||||||
|
return HistoricMessageAppearance::Crossed |
|
||||||
|
HistoricMessageAppearance::Greyed;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
return HistoricMessageAppearance::Crossed;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
return HistoricMessageAppearance::Greyed;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
return 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
false);
|
||||||
layout.addCheckbox("Emphasize deleted messages", s.redDisabledMessages);
|
layout.addCheckbox("Emphasize deleted messages", s.redDisabledMessages);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -298,7 +340,7 @@ void GeneralPage::initLayout(SettingsLayout &layout)
|
||||||
"Medium", "Low", "Audio only"});
|
"Medium", "Low", "Audio only"});
|
||||||
layout.addDropdown("Command line arguments", {"..."});
|
layout.addDropdown("Command line arguments", {"..."});
|
||||||
*/
|
*/
|
||||||
}
|
} // namespace chatterino
|
||||||
|
|
||||||
void GeneralPage::initExtra()
|
void GeneralPage::initExtra()
|
||||||
{
|
{
|
||||||
|
|
|
@ -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