From a6c3cb9798a2cbd1083870bfa233e904652e6a5e Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 21 Mar 2021 11:21:45 +0100 Subject: [PATCH] Marked the Grid view style as experimental in the UI settings. --- es-app/src/guis/GuiMenu.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 5a6d68628..2ec0ec20e 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -130,15 +130,16 @@ void GuiMenu::openUISettings() // GameList view style. auto gamelist_view_style = std::make_shared> (mWindow, getHelpStyle(), "GAMELIST VIEW STYLE", false); - std::vector styles; - styles.push_back("automatic"); - styles.push_back("basic"); - styles.push_back("detailed"); - styles.push_back("video"); - styles.push_back("grid"); - for (auto it = styles.cbegin(); it != styles.cend(); it++) - gamelist_view_style->add(*it, *it, Settings::getInstance()-> - getString("GamelistViewStyle") == *it); + std::string selectedViewStyle = Settings::getInstance()->getString("GamelistViewStyle"); + gamelist_view_style->add("automatic", "automatic", selectedViewStyle == "automatic"); + gamelist_view_style->add("basic", "basic", selectedViewStyle == "basic"); + gamelist_view_style->add("detailed", "detailed", selectedViewStyle == "detailed"); + gamelist_view_style->add("video", "video", selectedViewStyle == "video"); + gamelist_view_style->add("grid (experimental)", "grid", selectedViewStyle == "grid"); + // If there are no objects returned, then there must be a manually modified entry in the + // configuration file. Simply set the view style to Automatic in this case. + if (gamelist_view_style->getSelectedObjects().size() == 0) + gamelist_view_style->selectEntry(0); s->addWithLabel("GAMELIST VIEW STYLE", gamelist_view_style); s->addSaveFunc([gamelist_view_style, s] { if (gamelist_view_style->getSelected() !=