mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
HistoricMessageAppearance
Merge branch 'master' of https://github.com/fourtf/chatterino2
This commit is contained in:
commit
63b22ecf1d
5 changed files with 70 additions and 22 deletions
|
@ -385,6 +385,7 @@ HEADERS += \
|
|||
src/widgets/splits/ClosedSplits.hpp \
|
||||
src/providers/ffz/FfzModBadge.hpp \
|
||||
src/widgets/settingspages/GeneralPage.hpp \
|
||||
src/messages/HistoricMessageAppearance.hpp
|
||||
|
||||
RESOURCES += \
|
||||
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
|
|
@ -200,31 +200,25 @@ void MessageLayout::paint(QPainter &painter, int width, int y, int messageIndex,
|
|||
app->themes->messages.disabled);
|
||||
// painter.fillRect(0, y, pixmap->width(), pixmap->height(),
|
||||
// QBrush(QColor(64, 64, 64, 64)));
|
||||
painter.fillRect(0, y, pixmap->width(), pixmap->height(),
|
||||
QBrush(QColor(255, 0, 0, 63), Qt::BDiagPattern));
|
||||
// app->themes->messages.disabled);
|
||||
|
||||
if (getSettings()->redDisabledMessages)
|
||||
{
|
||||
painter.fillRect(0, y, pixmap->width(), pixmap->height(),
|
||||
QBrush(QColor(255, 0, 0, 63), Qt::BDiagPattern));
|
||||
// app->themes->messages.disabled);
|
||||
}
|
||||
}
|
||||
|
||||
if (this->message_->flags.has(MessageFlag::RecentMessage))
|
||||
{
|
||||
const auto &setting =
|
||||
const auto &historicMessageAppearance =
|
||||
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")
|
||||
if (historicMessageAppearance & HistoricMessageAppearance::Crossed)
|
||||
{
|
||||
painter.fillRect(0, y, pixmap->width(), pixmap->height(),
|
||||
QBrush(QColor(255, 0, 0, 63), Qt::BDiagPattern));
|
||||
}
|
||||
else if (setting == "Greyed")
|
||||
if (historicMessageAppearance & HistoricMessageAppearance::Greyed)
|
||||
{
|
||||
painter.fillRect(0, y, pixmap->width(), pixmap->height(),
|
||||
app->themes->messages.disabled);
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "controllers/highlights/HighlightPhrase.hpp"
|
||||
#include "controllers/moderationactions/ModerationAction.hpp"
|
||||
#include "messages/HistoricMessageAppearance.hpp"
|
||||
|
||||
#include <pajlada/settings/setting.hpp>
|
||||
#include <pajlada/settings/settinglistener.hpp>
|
||||
|
@ -31,9 +32,9 @@ public:
|
|||
Qt::VerPattern};
|
||||
QStringSetting lastMessageColor = {"/appearance/messages/lastMessageColor",
|
||||
""};
|
||||
QStringSetting historicMessagesAppearance = {
|
||||
IntSetting historicMessagesAppearance = {
|
||||
"/appearance/messages/historicMessagesAppearance",
|
||||
"Crossed and Greyed"};
|
||||
HistoricMessageAppearance::Crossed | HistoricMessageAppearance::Greyed};
|
||||
BoolSetting showEmptyInput = {"/appearance/showEmptyInputBox", true};
|
||||
BoolSetting showMessageLength = {"/appearance/messages/showMessageLength",
|
||||
false};
|
||||
|
@ -66,6 +67,7 @@ public:
|
|||
BoolSetting headerUptime = {"/appearance/splitheader/showUptime", false};
|
||||
FloatSetting customThemeMultiplier = {"/appearance/customThemeMultiplier",
|
||||
-0.5f};
|
||||
BoolSetting redDisabledMessages = {"/appearance/redStripes", true};
|
||||
// BoolSetting useCustomWindowFrame = {"/appearance/useCustomWindowFrame",
|
||||
// false};
|
||||
|
||||
|
|
|
@ -263,9 +263,50 @@ void GeneralPage::initLayout(SettingsLayout &layout)
|
|||
|
||||
layout.addTitle2("Misc");
|
||||
layout.addCheckbox("Show twitch whispers inline", s.inlineWhispers);
|
||||
layout.addDropdown("Historic messages appearance",
|
||||
{"Crossed and Greyed", "Crossed", "Greyed", "No change"},
|
||||
s.historicMessagesAppearance);
|
||||
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.addTitle2("Cache");
|
||||
|
@ -299,7 +340,7 @@ void GeneralPage::initLayout(SettingsLayout &layout)
|
|||
"Medium", "Low", "Audio only"});
|
||||
layout.addDropdown("Command line arguments", {"..."});
|
||||
*/
|
||||
}
|
||||
} // namespace chatterino
|
||||
|
||||
void GeneralPage::initExtra()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue