added custom window frame for windows
This commit is contained in:
@@ -44,8 +44,10 @@ AppearancePage::AppearancePage()
|
||||
form->addRow("Font:", this->createFontChanger());
|
||||
|
||||
form->addRow("Tab bar:", this->createCheckBox(TAB_X, settings.hideTabX));
|
||||
#ifndef USEWINSDK
|
||||
form->addRow("", this->createCheckBox(TAB_PREF, settings.hidePreferencesButton));
|
||||
form->addRow("", this->createCheckBox(TAB_USER, settings.hideUserButton));
|
||||
#endif
|
||||
|
||||
form->addRow("Scrolling:", this->createCheckBox(SCROLL_SMOOTH, settings.enableSmoothScrolling));
|
||||
form->addRow("", this->createCheckBox(SCROLL_NEWMSG, settings.enableSmoothScrollingNewMessages));
|
||||
@@ -59,6 +61,7 @@ AppearancePage::AppearancePage()
|
||||
{
|
||||
tbox.emplace<QLabel>("timestamp format (a = am/pm):");
|
||||
tbox.append(this->createComboBox({TIMESTAMP_FORMATS}, settings.timestampFormat));
|
||||
tbox->addStretch(1);
|
||||
}
|
||||
messages.append(this->createCheckBox("Show badges", settings.showBadges));
|
||||
messages.append(this->createCheckBox("Seperate messages", settings.seperateMessages));
|
||||
|
||||
@@ -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