ServiceMenu: ja es funcional en totes les seccions del programa
This commit is contained in:
@@ -25,9 +25,9 @@ public:
|
||||
// --- Métodos de control ---
|
||||
void setSelectorUp();
|
||||
void setSelectorDown();
|
||||
void setSelectorRight();
|
||||
void adjustOption(bool adjust_up);
|
||||
void setSelectorLeft();
|
||||
void acceptSelection();
|
||||
void selectOption();
|
||||
void moveBack();
|
||||
|
||||
// --- Getters ---
|
||||
@@ -36,6 +36,12 @@ public:
|
||||
private:
|
||||
using OptionPairs = std::vector<std::pair<std::string, std::string>>;
|
||||
|
||||
enum class Aspect
|
||||
{
|
||||
ASPECT1, // Fondo opaco y proyecta sombra
|
||||
ASPECT2 // Fondo translucido
|
||||
};
|
||||
|
||||
enum class SettingsGroup
|
||||
{
|
||||
VIDEO, // Configuraciones relacionadas con la calidad y resolución de imagen
|
||||
@@ -89,14 +95,14 @@ private:
|
||||
min_value(0), max_value(0), step_value(0), target_group(tgtGrp) {}
|
||||
|
||||
// Método para modificar el valor
|
||||
void adjustValue(bool increase)
|
||||
void adjustValue(bool adjust_up)
|
||||
{
|
||||
if (linked_variable)
|
||||
{
|
||||
if (type == ValueType::INT)
|
||||
{
|
||||
int &value = *(static_cast<int *>(linked_variable));
|
||||
int newValue = increase ? value + step_value : value - step_value;
|
||||
int newValue = adjust_up ? value + step_value : value - step_value;
|
||||
|
||||
// Asegurar que el nuevo valor se mantenga dentro de los límites
|
||||
value = std::clamp(newValue, min_value, max_value);
|
||||
@@ -136,6 +142,7 @@ private:
|
||||
OptionPairs option_pairs_; // Listado con las opciones de menu actuales (filtradas por grupo)
|
||||
SettingsGroup current_settings_group_; // Grupo actual
|
||||
SettingsGroup previous_settings_group_; // Grupo anterior
|
||||
Aspect aspect_ = Aspect::ASPECT2;
|
||||
|
||||
// -- Aspecto --
|
||||
Color bg_color_ = SERV_MENU_BG_COLOR; // Color de fondo
|
||||
|
||||
Reference in New Issue
Block a user