Added a menu option to enable or disable theme variant triggers.

This commit is contained in:
Leon Styhre 2023-01-31 19:26:39 +01:00
parent cc896bb626
commit 26860cd5cc
3 changed files with 17 additions and 2 deletions

View file

@ -685,6 +685,21 @@ void GuiMenu::openUIOptions()
screensaverRow.makeAcceptInputHandler(std::bind(&GuiMenu::openScreensaverOptions, this)); screensaverRow.makeAcceptInputHandler(std::bind(&GuiMenu::openScreensaverOptions, this));
s->addRow(screensaverRow); s->addRow(screensaverRow);
// Enable theme variant triggers.
auto themeVariantTriggers = std::make_shared<SwitchComponent>();
themeVariantTriggers->setState(Settings::getInstance()->getBool("ThemeVariantTriggers"));
s->addWithLabel("ENABLE THEME VARIANT TRIGGERS", themeVariantTriggers);
s->addSaveFunc([themeVariantTriggers, s] {
if (themeVariantTriggers->getState() !=
Settings::getInstance()->getBool("ThemeVariantTriggers")) {
Settings::getInstance()->setBool("ThemeVariantTriggers",
themeVariantTriggers->getState());
s->setNeedsSaving();
s->setNeedsReloading();
s->setInvalidateCachedBackground();
}
});
// Blur background when the menu is open. // Blur background when the menu is open.
auto menuBlurBackground = std::make_shared<SwitchComponent>(); auto menuBlurBackground = std::make_shared<SwitchComponent>();
menuBlurBackground->setState(Settings::getInstance()->getBool("MenuBlurBackground")); menuBlurBackground->setState(Settings::getInstance()->getBool("MenuBlurBackground"));

View file

@ -827,8 +827,7 @@ std::shared_ptr<GamelistView> ViewController::getGamelistView(SystemData* system
} }
} }
} }
else { else if (Settings::getInstance()->getBool("ThemeVariantTriggers")) {
// Variant triggers.
const auto overrides = system->getTheme()->getCurrentThemeSetSelectedVariantOverrides(); const auto overrides = system->getTheme()->getCurrentThemeSetSelectedVariantOverrides();
if (!overrides.empty()) { if (!overrides.empty()) {

View file

@ -203,6 +203,7 @@ void Settings::setDefaults()
#endif #endif
mBoolMap["ScreensaverVideoBlur"] = {false, false}; mBoolMap["ScreensaverVideoBlur"] = {false, false};
mBoolMap["ThemeVariantTriggers"] = {true, true};
mBoolMap["MenuBlurBackground"] = {true, true}; mBoolMap["MenuBlurBackground"] = {true, true};
mBoolMap["GamelistVideoPillarbox"] = {true, true}; mBoolMap["GamelistVideoPillarbox"] = {true, true};
mBoolMap["GamelistVideoScanlines"] = {false, false}; mBoolMap["GamelistVideoScanlines"] = {false, false};