Add "Timeout action" setting

This commit is contained in:
Rasmus Karlsson 2018-03-24 16:55:28 +01:00 committed by fourtf
parent 41fbcc738b
commit 9886021c6a
4 changed files with 10 additions and 1 deletions

View file

@ -164,7 +164,7 @@ void MessageLayout::paint(QPainter &painter, int y, int messageIndex, Selection
QColor color = isWindowFocused ? themeManager.tabs.selected.backgrounds.regular.color()
: themeManager.tabs.selected.backgrounds.unfocused.color();
QBrush brush = QBrush(color, Qt::VerPattern);
QBrush brush(color, Qt::VerPattern);
painter.fillRect(0, y + this->container.getHeight() - 1, this->container.getWidth(), 1,
brush);

View file

@ -82,6 +82,7 @@ public:
/// Moderation
QStringSetting moderationActions = {"/moderation/actions", "/ban {user}\n/timeout {user} 300"};
QStringSetting timeoutAction = {"/moderation/timeoutAction", "Disable"};
/// Highlighting
BoolSetting enableHighlights = {"/highlighting/enabled", true};

View file

@ -13,6 +13,7 @@
namespace chatterino {
namespace widgets {
namespace settingspages {
ModerationPage::ModerationPage()
: SettingsPage("Moderation", "")
{
@ -27,6 +28,12 @@ ModerationPage::ModerationPage()
label->setStyleSheet("color: #bbb");
// clang-format on
auto form = layout.emplace<QFormLayout>();
{
form->addRow("Action on timed out messages (unimplemented):",
this->createComboBox({"Disable", "Hide"}, settings.timeoutAction));
}
auto modButtons =
layout.emplace<QGroupBox>("Custom moderator buttons").setLayoutType<QVBoxLayout>();
{

View file

@ -18,6 +18,7 @@ public:
private:
QTimer itemsChangedTimer;
};
} // namespace settingspages
} // namespace widgets
} // namespace chatterino