added custom window frame for windows
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "moderationpage.hpp"
|
||||
|
||||
#include <QGroupBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QListView>
|
||||
@@ -18,22 +19,33 @@ ModerationPage::ModerationPage()
|
||||
singletons::SettingManager &settings = singletons::SettingManager::getInstance();
|
||||
util::LayoutCreator<ModerationPage> layoutCreator(this);
|
||||
|
||||
auto layout = layoutCreator.emplace<QVBoxLayout>().withoutMargin();
|
||||
auto layout = layoutCreator.setLayoutType<QVBoxLayout>();
|
||||
{
|
||||
// clang-format off
|
||||
auto label = layout.emplace<QLabel>("In channels that you moderate there is a button <insert image of button here> to enable moderation mode.\n\nOne action per line. {user} will be replaced with the username.\nExample `/timeout {user} 120`");
|
||||
auto label = layout.emplace<QLabel>("Click the moderation mod button (<img width='18' height='18' src=':/images/moderatormode_disabled.png'>) in a channel that you moderate to enable moderator mode.<br>");
|
||||
label->setWordWrap(true);
|
||||
label->setStyleSheet("color: #bbb");
|
||||
// clang-format on
|
||||
|
||||
auto text = layout.emplace<QTextEdit>().getElement();
|
||||
auto modButtons =
|
||||
layout.emplace<QGroupBox>("Custom moderator buttons").setLayoutType<QVBoxLayout>();
|
||||
{
|
||||
auto label2 =
|
||||
modButtons.emplace<QLabel>("One action per line. {user} will be replaced with the "
|
||||
"username.<br>Example `/timeout {user} 120`<br>");
|
||||
label2->setWordWrap(true);
|
||||
|
||||
text->setPlainText(settings.moderationActions);
|
||||
auto text = modButtons.emplace<QTextEdit>().getElement();
|
||||
|
||||
QObject::connect(text, &QTextEdit::textChanged, this,
|
||||
[this] { this->itemsChangedTimer.start(200); });
|
||||
text->setPlainText(settings.moderationActions);
|
||||
|
||||
QObject::connect(&this->itemsChangedTimer, &QTimer::timeout, this,
|
||||
[text, &settings]() { settings.moderationActions = text->toPlainText(); });
|
||||
QObject::connect(text, &QTextEdit::textChanged, this,
|
||||
[this] { this->itemsChangedTimer.start(200); });
|
||||
|
||||
QObject::connect(&this->itemsChangedTimer, &QTimer::timeout, this, [text, &settings]() {
|
||||
settings.moderationActions = text->toPlainText();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// ---- misc
|
||||
|
||||
Reference in New Issue
Block a user