ServiceMenu: text justificat o centrat segons el submenu

ServiceMenu: alt de la finestra en funció del submenu amb mes items
This commit is contained in:
2025-06-06 20:59:42 +02:00
parent a76740f0b7
commit 0010d64d62
2 changed files with 72 additions and 8 deletions

View File

@@ -35,7 +35,8 @@ public:
private:
using OptionPairs = std::vector<std::pair<std::string, std::string>>;
static constexpr const char* MENU_SOUND_ = "clock.wav";
static constexpr const char *MENU_SOUND_ = "clock.wav";
static constexpr int OPTIONS_HORIZONTAL_PADDING_ = 20;
enum class Aspect
{
@@ -66,6 +67,12 @@ private:
NONE
};
enum class GroupAlignment
{
CENTERED,
LEFT
};
struct OptionEntry
{
std::string caption; // Texto visible en el menú
@@ -164,6 +171,9 @@ private:
void applySettings(SettingsGroup group);
void updateMenu(SettingsGroup group);
void reset();
int calculateMenuHeight();
int findLargestGroupSize();
GroupAlignment getGroupAlignment(SettingsGroup group);
// --- Patrón Singleton ---
ServiceMenu(); // Constructor privado