Fixed an issue where changing view style did not invalidate the cached background.

This commit is contained in:
Leon Styhre 2020-10-20 21:10:23 +02:00
parent 87bd205a3f
commit 4831279543

View file

@ -247,12 +247,13 @@ void GuiMenu::openUISettings()
gamelist_style->add(*it, *it, Settings::getInstance()-> gamelist_style->add(*it, *it, Settings::getInstance()->
getString("GamelistViewStyle") == *it); getString("GamelistViewStyle") == *it);
s->addWithLabel("GAMELIST VIEW STYLE", gamelist_style); s->addWithLabel("GAMELIST VIEW STYLE", gamelist_style);
s->addSaveFunc([gamelist_style] { s->addSaveFunc([gamelist_style, this] {
bool needReload = false; bool needReload = false;
if (Settings::getInstance()->getString("GamelistViewStyle") != if (Settings::getInstance()->getString("GamelistViewStyle") !=
gamelist_style->getSelected()) gamelist_style->getSelected())
needReload = true; needReload = true;
Settings::getInstance()->setString("GamelistViewStyle", gamelist_style->getSelected()); Settings::getInstance()->setString("GamelistViewStyle", gamelist_style->getSelected());
mWindow->invalidateCachedBackground();
if (needReload) if (needReload)
ViewController::get()->reloadAll(); ViewController::get()->reloadAll();
}); });