mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
moved and renamed similarity settings to R9K
This commit is contained in:
parent
0d519b479c
commit
d16732f023
2 changed files with 27 additions and 29 deletions
|
@ -412,6 +412,32 @@ void GeneralPage::initLayout(SettingsLayout &layout)
|
||||||
"Apple", "Google", "Messenger"},
|
"Apple", "Google", "Messenger"},
|
||||||
s.emojiSet);
|
s.emojiSet);
|
||||||
|
|
||||||
|
layout.addTitle("R9K");
|
||||||
|
layout.addDescription(
|
||||||
|
"Hide similar messages by the same user. Temporarily show hidden "
|
||||||
|
"messages by pressing Ctrl+H.");
|
||||||
|
layout.addCheckbox("Hide similar messages", s.similarityEnabled);
|
||||||
|
//layout.addCheckbox("Gray out matches", s.colorSimilarDisabled);
|
||||||
|
layout.addCheckbox("Hide my own messages", s.hideSimilarMyself);
|
||||||
|
layout.addCheckbox("Receive notification sounds from hidden messages",
|
||||||
|
s.shownSimilarTriggerHighlights);
|
||||||
|
s.hideSimilar.connect(
|
||||||
|
[]() { getApp()->windows->forceLayoutChannelViews(); }, false);
|
||||||
|
layout.addDropdown<float>(
|
||||||
|
"Similarity threshold", {"0.5", "0.75", "0.9"}, s.similarityPercentage,
|
||||||
|
[](auto val) { return QString::number(val); },
|
||||||
|
[](auto args) { return fuzzyToFloat(args.value, 0.9f); });
|
||||||
|
layout.addDropdown<int>(
|
||||||
|
"Maximum delay between messages",
|
||||||
|
{"5s", "10s", "15s", "30s", "60s", "120s"}, s.hideSimilarMaxDelay,
|
||||||
|
[](auto val) { return QString::number(val) + "s"; },
|
||||||
|
[](auto args) { return fuzzyToInt(args.value, 5); });
|
||||||
|
layout.addDropdown<int>(
|
||||||
|
"Amount of previous messages to check", {"1", "2", "3", "4", "5"},
|
||||||
|
s.hideSimilarMaxMessagesToCheck,
|
||||||
|
[](auto val) { return QString::number(val); },
|
||||||
|
[](auto args) { return fuzzyToInt(args.value, 3); });
|
||||||
|
|
||||||
layout.addTitle("Visible badges");
|
layout.addTitle("Visible badges");
|
||||||
layout.addCheckbox("Authority (staff, admin)",
|
layout.addCheckbox("Authority (staff, admin)",
|
||||||
getSettings()->showBadgesGlobalAuthority);
|
getSettings()->showBadgesGlobalAuthority);
|
||||||
|
@ -547,33 +573,6 @@ void GeneralPage::initLayout(SettingsLayout &layout)
|
||||||
QDesktopServices::openUrl(getPaths()->rootAppDataDirectory);
|
QDesktopServices::openUrl(getPaths()->rootAppDataDirectory);
|
||||||
});
|
});
|
||||||
|
|
||||||
layout.addTitle("Similarity");
|
|
||||||
layout.addDescription(
|
|
||||||
"Hides or grays out similar messages from the same user");
|
|
||||||
layout.addCheckbox("Similarity enabled", s.similarityEnabled);
|
|
||||||
layout.addCheckbox("Gray out similar messages", s.colorSimilarDisabled);
|
|
||||||
layout.addCheckbox("Hide similar messages (Ctrl + H)", s.hideSimilar);
|
|
||||||
layout.addCheckbox("Hide or gray out my own similar messages",
|
|
||||||
s.hideSimilarMyself);
|
|
||||||
layout.addCheckbox("Shown similar messages trigger highlights",
|
|
||||||
s.shownSimilarTriggerHighlights);
|
|
||||||
layout.addDropdown<float>(
|
|
||||||
"Similarity percentage", {"0.5", "0.75", "0.9"}, s.similarityPercentage,
|
|
||||||
[](auto val) { return QString::number(val); },
|
|
||||||
[](auto args) { return fuzzyToFloat(args.value, 0.9f); });
|
|
||||||
s.hideSimilar.connect(
|
|
||||||
[]() { getApp()->windows->forceLayoutChannelViews(); }, false);
|
|
||||||
layout.addDropdown<int>(
|
|
||||||
"Similar messages max delay in seconds",
|
|
||||||
{"5", "10", "15", "30", "60", "120"}, s.hideSimilarMaxDelay,
|
|
||||||
[](auto val) { return QString::number(val); },
|
|
||||||
[](auto args) { return fuzzyToInt(args.value, 5); });
|
|
||||||
layout.addDropdown<int>(
|
|
||||||
"Similar messages max previous messages to check",
|
|
||||||
{"1", "2", "3", "4", "5"}, s.hideSimilarMaxMessagesToCheck,
|
|
||||||
[](auto val) { return QString::number(val); },
|
|
||||||
[](auto args) { return fuzzyToInt(args.value, 3); });
|
|
||||||
|
|
||||||
// invisible element for width
|
// invisible element for width
|
||||||
auto inv = new BaseWidget(this);
|
auto inv = new BaseWidget(this);
|
||||||
inv->setScaleIndependantWidth(500);
|
inv->setScaleIndependantWidth(500);
|
||||||
|
|
|
@ -42,8 +42,7 @@ IgnoresPage::IgnoresPage()
|
||||||
|
|
||||||
void addPhrasesTab(LayoutCreator<QVBoxLayout> layout)
|
void addPhrasesTab(LayoutCreator<QVBoxLayout> layout)
|
||||||
{
|
{
|
||||||
layout.emplace<QLabel>("Messages can be ignored if "
|
layout.emplace<QLabel>("Ignore messages based certain patterns.");
|
||||||
"they match a certain pattern.");
|
|
||||||
EditableModelView *view =
|
EditableModelView *view =
|
||||||
layout
|
layout
|
||||||
.emplace<EditableModelView>(getApp()->ignores->createModel(nullptr))
|
.emplace<EditableModelView>(getApp()->ignores->createModel(nullptr))
|
||||||
|
|
Loading…
Reference in a new issue