diff --git a/src/singletons/Settings.hpp b/src/singletons/Settings.hpp index 72bd0ce0b..03c5195ab 100644 --- a/src/singletons/Settings.hpp +++ b/src/singletons/Settings.hpp @@ -29,7 +29,6 @@ public: "/appearance/enableAnimationsWhenFocused", false}; QStringSetting timestampFormat = {"/appearance/messages/timestampFormat", "h:mm"}; - BoolSetting showBadges = {"/appearance/messages/showBadges", true}; BoolSetting showLastMessageIndicator = { "/appearance/messages/showLastMessageIndicator", false}; IntSetting lastMessagePattern = {"/appearance/messages/lastMessagePattern", @@ -67,6 +66,16 @@ public: // BoolSetting useCustomWindowFrame = {"/appearance/useCustomWindowFrame", // false}; + // Badges + BoolSetting showBadgesGlobalAuthority = { + "/appearance/badges/GlobalAuthority", true}; + BoolSetting showBadgesChannelAuthority = { + "/appearance/badges/ChannelAuthority", true}; + BoolSetting showBadgesSubscription = {"/appearance/badges/subscription", + true}; + BoolSetting showBadgesVanity = {"/appearance/badges/vanity", true}; + BoolSetting showBadgesChatterino = {"/appearance/badges/chatterino", true}; + /// Behaviour BoolSetting allowDuplicateMessages = {"/behaviour/allowDuplicateMessages", true}; diff --git a/src/singletons/WindowManager.cpp b/src/singletons/WindowManager.cpp index 02b711f7b..dc6f9c63a 100644 --- a/src/singletons/WindowManager.cpp +++ b/src/singletons/WindowManager.cpp @@ -69,7 +69,11 @@ WindowManager::WindowManager() auto settings = getSettings(); this->wordFlagsListener_.addSetting(settings->showTimestamps); - this->wordFlagsListener_.addSetting(settings->showBadges); + this->wordFlagsListener_.addSetting(settings->showBadgesGlobalAuthority); + this->wordFlagsListener_.addSetting(settings->showBadgesChannelAuthority); + this->wordFlagsListener_.addSetting(settings->showBadgesSubscription); + this->wordFlagsListener_.addSetting(settings->showBadgesVanity); + this->wordFlagsListener_.addSetting(settings->showBadgesChatterino); this->wordFlagsListener_.addSetting(settings->enableBttvEmotes); this->wordFlagsListener_.addSetting(settings->enableEmojis); this->wordFlagsListener_.addSetting(settings->enableFfzEmotes); @@ -114,7 +118,15 @@ void WindowManager::updateWordTypeMask() : MEF::BitsStatic); // badges - flags.set(settings->showBadges ? MEF::Badges : MEF::None); + flags.set(settings->showBadgesGlobalAuthority ? MEF::BadgeGlobalAuthority + : MEF::None); + flags.set(settings->showBadgesChannelAuthority ? MEF::BadgeChannelAuthority + : MEF::None); + flags.set(settings->showBadgesSubscription ? MEF::BadgeSubscription + : MEF::None); + flags.set(settings->showBadgesVanity ? MEF::BadgeVanity : MEF::None); + flags.set(settings->showBadgesChatterino ? MEF::BadgeChatterino + : MEF::None); // username flags.set(MEF::Username); diff --git a/src/widgets/settingspages/LookPage.cpp b/src/widgets/settingspages/LookPage.cpp index f153fc876..ef89a1840 100644 --- a/src/widgets/settingspages/LookPage.cpp +++ b/src/widgets/settingspages/LookPage.cpp @@ -59,6 +59,7 @@ void LookPage::initializeUi() this->addMessageTab(tabs.appendTab(new QVBoxLayout, "Messages")); this->addEmoteTab(tabs.appendTab(new QVBoxLayout, "Emotes")); this->addSplitHeaderTab(tabs.appendTab(new QVBoxLayout, "Split header")); + this->addBadgesTab(tabs.appendTab(new QVBoxLayout, "Badges")); layout->addStretch(1); @@ -145,10 +146,6 @@ void LookPage::addMessageTab(LayoutCreator layout) box->addStretch(1); } - // badges - layout.append( - this->createCheckBox("Show badges", getSettings()->showBadges)); - // -- layout.emplace(false); @@ -280,6 +277,47 @@ void LookPage::addSplitHeaderTab(LayoutCreator layout) layout->addStretch(1); } +void LookPage::addBadgesTab(LayoutCreator layout) +{ + // layout.append( + // this->createCheckBox(("Show all badges"), getSettings()->showBadges)); + auto fastSelection = layout.emplace(); + { + auto addAll = fastSelection.emplace("Enable all"); + QObject::connect(addAll.getElement(), &QPushButton::clicked, this, [] { + getSettings()->showBadgesGlobalAuthority = true; + getSettings()->showBadgesChannelAuthority = true; + getSettings()->showBadgesSubscription = true; + getSettings()->showBadgesVanity = true; + getSettings()->showBadgesChatterino = true; + }); + auto removeAll = fastSelection.emplace("Disable all"); + QObject::connect(removeAll.getElement(), &QPushButton::clicked, this, + [] { + getSettings()->showBadgesGlobalAuthority = false; + getSettings()->showBadgesChannelAuthority = false; + getSettings()->showBadgesSubscription = false; + getSettings()->showBadgesVanity = false; + getSettings()->showBadgesChatterino = false; + }); + } + layout.emplace(false); + layout.append(this->createCheckBox( + ("Show authorty badges (staff, admin, turbo, etc)"), + getSettings()->showBadgesGlobalAuthority)); + layout.append( + this->createCheckBox(("Show channel badges (broadcaster, moderator)"), + getSettings()->showBadgesChannelAuthority)); + layout.append(this->createCheckBox(("Show subscriber badges "), + getSettings()->showBadgesSubscription)); + layout.append( + this->createCheckBox(("Show vanity badges (prime, bits, subgifter)"), + getSettings()->showBadgesVanity)); + layout.append(this->createCheckBox(("Show chatterino badges"), + getSettings()->showBadgesChatterino)); + layout->addStretch(1); +} + void LookPage::addLastReadMessageIndicatorPatternSelector( LayoutCreator layout) { diff --git a/src/widgets/settingspages/LookPage.hpp b/src/widgets/settingspages/LookPage.hpp index d7f9102ee..a69c3f2f7 100644 --- a/src/widgets/settingspages/LookPage.hpp +++ b/src/widgets/settingspages/LookPage.hpp @@ -23,6 +23,7 @@ private: void addMessageTab(LayoutCreator layout); void addEmoteTab(LayoutCreator layout); void addSplitHeaderTab(LayoutCreator layout); + void addBadgesTab(LayoutCreator layout); void addLastReadMessageIndicatorPatternSelector( LayoutCreator layout);