added descriptions to collection settings

This commit is contained in:
fourtf 2019-08-26 14:36:06 +02:00
parent e7b4527a0f
commit f949605477
3 changed files with 19 additions and 9 deletions

View file

@ -44,8 +44,11 @@ HighlightingPage::HighlightingPage()
auto tabs = layout.emplace<QTabWidget>(); auto tabs = layout.emplace<QTabWidget>();
{ {
// HIGHLIGHTS // HIGHLIGHTS
auto highlights = tabs.appendTab(new QVBoxLayout, "Phrases"); auto highlights = tabs.appendTab(new QVBoxLayout, "Messages");
{ {
highlights.emplace<QLabel>("Messages can be highlighted if "
"they match a certain pattern.");
EditableModelView *view = EditableModelView *view =
highlights highlights
.emplace<EditableModelView>( .emplace<EditableModelView>(
@ -75,6 +78,8 @@ HighlightingPage::HighlightingPage()
auto pingUsers = tabs.appendTab(new QVBoxLayout, "Users"); auto pingUsers = tabs.appendTab(new QVBoxLayout, "Users");
{ {
pingUsers.emplace<QLabel>(
"Messages from a certain user can be highlighted.");
EditableModelView *view = EditableModelView *view =
pingUsers pingUsers
.emplace<EditableModelView>( .emplace<EditableModelView>(
@ -106,6 +111,9 @@ HighlightingPage::HighlightingPage()
auto disabledUsers = auto disabledUsers =
tabs.appendTab(new QVBoxLayout, "Excluded Users"); tabs.appendTab(new QVBoxLayout, "Excluded Users");
{ {
disabledUsers.emplace<QLabel>(
"This is a list of users (e.g. bots) whose messages should "
"<u>not</u> be highlighted.");
EditableModelView *view = EditableModelView *view =
disabledUsers disabledUsers
.emplace<EditableModelView>( .emplace<EditableModelView>(

View file

@ -19,7 +19,7 @@
#include <QVBoxLayout> #include <QVBoxLayout>
// clang-format off // clang-format off
#define INFO "/ignore <user> in chat ignores a user\n/unignore <user> in chat unignores a user" #define INFO "/ignore <user> in chat ignores a user.\n/unignore <user> in chat unignores a user.\nYou can also click on a user to open the usercard."
// clang-format on // clang-format on
namespace chatterino { namespace chatterino {
@ -35,17 +35,15 @@ IgnoresPage::IgnoresPage()
auto layout = layoutCreator.setLayoutType<QVBoxLayout>(); auto layout = layoutCreator.setLayoutType<QVBoxLayout>();
auto tabs = layout.emplace<QTabWidget>(); auto tabs = layout.emplace<QTabWidget>();
addPhrasesTab(tabs.appendTab(new QVBoxLayout, "Phrases")); addPhrasesTab(tabs.appendTab(new QVBoxLayout, "Messages"));
addUsersTab(*this, tabs.appendTab(new QVBoxLayout, "Users"), addUsersTab(*this, tabs.appendTab(new QVBoxLayout, "Users"),
this->userListModel_); this->userListModel_);
auto label = layout.emplace<QLabel>(INFO);
label->setWordWrap(true);
label->setStyleSheet("color: #BBB");
} }
void addPhrasesTab(LayoutCreator<QVBoxLayout> layout) void addPhrasesTab(LayoutCreator<QVBoxLayout> layout)
{ {
layout.emplace<QLabel>("Messages can be ignored if "
"they match a certain pattern.");
EditableModelView *view = EditableModelView *view =
layout layout
.emplace<EditableModelView>(getApp()->ignores->createModel(nullptr)) .emplace<EditableModelView>(getApp()->ignores->createModel(nullptr))
@ -65,7 +63,7 @@ void addPhrasesTab(LayoutCreator<QVBoxLayout> layout)
view->addButtonPressed.connect([] { view->addButtonPressed.connect([] {
getApp()->ignores->phrases.appendItem( getApp()->ignores->phrases.appendItem(
IgnorePhrase{"my phrase", false, false, IgnorePhrase{"my pattern", false, false,
getSettings()->ignoredPhraseReplace.getValue(), true}); getSettings()->ignoredPhraseReplace.getValue(), true});
}); });
} }
@ -73,6 +71,8 @@ void addPhrasesTab(LayoutCreator<QVBoxLayout> layout)
void addUsersTab(IgnoresPage &page, LayoutCreator<QVBoxLayout> users, void addUsersTab(IgnoresPage &page, LayoutCreator<QVBoxLayout> users,
QStringListModel &userModel) QStringListModel &userModel)
{ {
auto label = users.emplace<QLabel>(INFO);
label->setWordWrap(true);
users.append(page.createCheckBox("Enable twitch ignored users", users.append(page.createCheckBox("Enable twitch ignored users",
getSettings()->enableTwitchIgnoredUsers)); getSettings()->enableTwitchIgnoredUsers));
@ -106,6 +106,7 @@ void addUsersTab(IgnoresPage &page, LayoutCreator<QVBoxLayout> users,
addremove->addStretch(1); addremove->addStretch(1);
}*/ }*/
users.emplace<QLabel>("List of ignored users:");
users.emplace<QListView>()->setModel(&userModel); users.emplace<QListView>()->setModel(&userModel);
} }

View file

@ -77,7 +77,8 @@ NotificationPage::NotificationPage()
settings->addStretch(1); settings->addStretch(1);
} }
auto twitchChannels = tabs.appendTab(new QVBoxLayout, "Twitch"); auto twitchChannels =
tabs.appendTab(new QVBoxLayout, "Channel going live");
{ {
EditableModelView *view = EditableModelView *view =
twitchChannels twitchChannels