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));
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.
auto menuBlurBackground = std::make_shared<SwitchComponent>();
menuBlurBackground->setState(Settings::getInstance()->getBool("MenuBlurBackground"));

View file

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

View file

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