mirror-chatterino2/src/widgets/settingspages/ignoreuserspage.cpp

74 lines
2.2 KiB
C++
Raw Normal View History

2018-01-23 21:33:49 +01:00
#include "ignoreuserspage.hpp"
#include "application.hpp"
2018-01-23 21:33:49 +01:00
#include "singletons/settingsmanager.hpp"
#include "util/layoutcreator.hpp"
#include <QCheckBox>
#include <QGroupBox>
2018-01-23 21:33:49 +01:00
#include <QLabel>
#include <QListView>
#include <QPushButton>
#include <QVBoxLayout>
// clang-format off
2018-04-26 23:07:02 +02:00
#define INFO "/ignore <user> in chat ignores a user\n/unignore <user> in chat unignores a user"
2018-01-23 21:33:49 +01:00
// clang-format on
namespace chatterino {
namespace widgets {
namespace settingspages {
2018-01-23 21:33:49 +01:00
IgnoreUsersPage::IgnoreUsersPage()
2018-04-26 23:07:02 +02:00
: SettingsPage("Ignores", "")
2018-01-23 21:33:49 +01:00
{
auto app = getApp();
2018-01-23 21:33:49 +01:00
util::LayoutCreator<IgnoreUsersPage> layoutCreator(this);
auto layout = layoutCreator.setLayoutType<QVBoxLayout>();
2018-01-23 21:33:49 +01:00
2018-04-27 01:11:09 +02:00
// auto group = layout.emplace<QGroupBox>("Ignored users").setLayoutType<QVBoxLayout>();
auto tabs = layout.emplace<QTabWidget>();
tabs->setStyleSheet("color: #000");
// users
auto users = tabs.appendTab(new QVBoxLayout, "Users");
2018-01-23 21:33:49 +01:00
{
users.append(this->createCheckBox("Enable twitch ignored users",
app->settings->enableTwitchIgnoredUsers));
2018-04-27 01:11:09 +02:00
auto anyways = users.emplace<QHBoxLayout>().withoutMargin();
{
anyways.emplace<QLabel>("Show anyways if:");
anyways.emplace<QComboBox>();
anyways->addStretch(1);
}
2018-04-27 01:11:09 +02:00
auto addremove = users.emplace<QHBoxLayout>().withoutMargin();
{
auto add = addremove.emplace<QPushButton>("Ignore user");
auto remove = addremove.emplace<QPushButton>("Unignore User");
UNUSED(add); // TODO: Add on-clicked event
UNUSED(remove); // TODO: Add on-clicked event
addremove->addStretch(1);
}
2018-04-27 01:11:09 +02:00
auto userList = users.emplace<QListView>();
UNUSED(userList); // TODO: Fill this list in with ignored users
2018-01-23 21:33:49 +01:00
}
2018-04-26 23:07:02 +02:00
2018-04-27 01:11:09 +02:00
// messages
auto messages = tabs.appendTab(new QVBoxLayout, "Messages");
{
messages.emplace<QLabel>("wip");
}
2018-04-26 23:07:02 +02:00
auto label = layout.emplace<QLabel>(INFO);
label->setWordWrap(true);
label->setStyleSheet("color: #BBB");
2018-01-23 21:33:49 +01:00
}
2018-01-23 21:33:49 +01:00
} // namespace settingspages
} // namespace widgets
} // namespace chatterino