fix ServiceMenu: amaga TOTES les opcions que s'han d'amagar al inici (not tested pq en macos no va el fullscreen d'inici)

This commit is contained in:
2025-06-29 12:44:13 +02:00
parent 97f6a459ea
commit 5212674093
2 changed files with 22 additions and 9 deletions

View File

@@ -193,10 +193,7 @@ void ServiceMenu::applySettings()
void ServiceMenu::applyVideoSettings()
{
Screen::get()->applySettings();
auto option = getOptionByCaption(Lang::getText("[SERVICE_MENU] WINDOW_SIZE"));
if (option)
option->setHidden(Options::video.fullscreen);
updateMenu(); // El menú debe refrescarse si algo se oculta
setHiddenOptions();
}
void ServiceMenu::applyAudioSettings()
@@ -206,10 +203,7 @@ void ServiceMenu::applyAudioSettings()
void ServiceMenu::applySettingsSettings()
{
auto option = getOptionByCaption(Lang::getText("[SERVICE_MENU] SHUTDOWN"));
if (option)
option->setHidden(!Options::settings.shutdown_enabled);
updateMenu(); // El menú debe refrescarse si algo se oculta
setHiddenOptions();
}
MenuOption *ServiceMenu::getOptionByCaption(const std::string &caption) const
@@ -294,7 +288,7 @@ void ServiceMenu::initializeOptions()
options_.push_back(std::make_unique<FolderOption>(Lang::getText("[SERVICE_MENU] SETTINGS"), SettingsGroup::MAIN, SettingsGroup::SETTINGS));
options_.push_back(std::make_unique<FolderOption>(Lang::getText("[SERVICE_MENU] SYSTEM"), SettingsGroup::MAIN, SettingsGroup::SYSTEM));
// precalculateMenuWidths();
setHiddenOptions();
}
// Sincroniza los valores de las opciones tipo lista
@@ -331,3 +325,21 @@ std::string ServiceMenu::settingsGroupToString(SettingsGroup group) const
return Lang::getText("[SERVICE_MENU] TITLE");
}
}
// Establece el estado de oculto de ciertas opciones
void ServiceMenu::setHiddenOptions()
{
{
auto option = getOptionByCaption(Lang::getText("[SERVICE_MENU] WINDOW_SIZE"));
if (option)
option->setHidden(Options::video.fullscreen);
}
{
auto option = getOptionByCaption(Lang::getText("[SERVICE_MENU] SHUTDOWN"));
if (option)
option->setHidden(!Options::settings.shutdown_enabled);
}
updateMenu(); // El menú debe refrescarse si algo se oculta
}