Merge pull request #645 from pjft/kids-start-menu

Option to show start menu in Kids mode
This commit is contained in:
pjft 2020-04-27 10:00:45 +01:00 committed by GitHub
commit 9c46f50497
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View file

@ -366,6 +366,12 @@ void GuiMenu::openUISettings()
if (enable_filter->getState() != filter_is_enabled) ViewController::get()->ReloadAndGoToStart(); if (enable_filter->getState() != filter_is_enabled) ViewController::get()->ReloadAndGoToStart();
}); });
// hide start menu in Kid Mode
auto disable_start = std::make_shared<SwitchComponent>(mWindow);
disable_start->setState(Settings::getInstance()->getBool("DisableKidStartMenu"));
s->addWithLabel("DISABLE START MENU IN KID MODE", disable_start);
s->addSaveFunc([disable_start] { Settings::getInstance()->setBool("DisableKidStartMenu", disable_start->getState()); });
mWindow->pushGui(s); mWindow->pushGui(s);
} }

View file

@ -366,7 +366,7 @@ bool ViewController::input(InputConfig* config, Input input)
return true; return true;
// open menu // open menu
if(!UIModeController::getInstance()->isUIModeKid() && config->isMappedTo("start", input) && input.value != 0) if(!(UIModeController::getInstance()->isUIModeKid() && Settings::getInstance()->getBool("DisableKidStartMenu")) && config->isMappedTo("start", input) && input.value != 0)
{ {
// open menu // open menu
mWindow->pushGui(new GuiMenu(mWindow)); mWindow->pushGui(new GuiMenu(mWindow));
@ -533,7 +533,7 @@ std::vector<HelpPrompt> ViewController::getHelpPrompts()
return prompts; return prompts;
prompts = mCurrentView->getHelpPrompts(); prompts = mCurrentView->getHelpPrompts();
if(!UIModeController::getInstance()->isUIModeKid()) if(!(UIModeController::getInstance()->isUIModeKid() && Settings::getInstance()->getBool("DisableKidStartMenu")))
prompts.push_back(HelpPrompt("start", "menu")); prompts.push_back(HelpPrompt("start", "menu"));
return prompts; return prompts;

View file

@ -65,6 +65,7 @@ void Settings::setDefaults()
mBoolMap["SplashScreen"] = true; mBoolMap["SplashScreen"] = true;
mBoolMap["SplashScreenProgress"] = true; mBoolMap["SplashScreenProgress"] = true;
mStringMap["StartupSystem"] = ""; mStringMap["StartupSystem"] = "";
mBoolMap["DisableKidStartMenu"] = true;
mBoolMap["VSync"] = true; mBoolMap["VSync"] = true;