From f22baf650cd01d1e1dbae0568db267776deb2d6b Mon Sep 17 00:00:00 2001 From: philmoz Date: Mon, 21 Apr 2025 11:15:41 +1000 Subject: [PATCH] feat(color): increase max length for widget name (#6099) --- companion/src/firmwares/customisation_data.h | 2 +- companion/src/modeledit/colorcustomscreens.cpp | 6 +++--- radio/src/datastructs.h | 18 +++++++++--------- .../gui/colorlcd/mainview/widgets_container.h | 2 +- .../src/storage/yaml/yaml_datastructs_f16.cpp | 12 ++++++------ .../src/storage/yaml/yaml_datastructs_nb4p.cpp | 12 ++++++------ .../yaml/yaml_datastructs_nv14_family.cpp | 12 ++++++------ .../src/storage/yaml/yaml_datastructs_st16.cpp | 12 ++++++------ .../src/storage/yaml/yaml_datastructs_t15.cpp | 12 ++++++------ .../src/storage/yaml/yaml_datastructs_x10.cpp | 12 ++++++------ 10 files changed, 50 insertions(+), 50 deletions(-) diff --git a/companion/src/firmwares/customisation_data.h b/companion/src/firmwares/customisation_data.h index 8974285df..0e9bb60ad 100644 --- a/companion/src/firmwares/customisation_data.h +++ b/companion/src/firmwares/customisation_data.h @@ -36,7 +36,7 @@ constexpr int MAX_THEME_OPTIONS {5}; constexpr int LEN_ZONE_OPTION_STRING {8}; constexpr int MAX_LAYOUT_ZONES {10}; constexpr int MAX_LAYOUT_OPTIONS {10}; -constexpr int WIDGET_NAME_LEN {12}; +constexpr int WIDGET_NAME_LEN {20}; constexpr int MAX_WIDGET_OPTIONS {5}; constexpr int MAX_TOPBAR_ZONES {6}; // max 4 used for portrait constexpr int MAX_TOPBAR_OPTIONS {1}; diff --git a/companion/src/modeledit/colorcustomscreens.cpp b/companion/src/modeledit/colorcustomscreens.cpp index 5d748d9f8..e4de09c4e 100644 --- a/companion/src/modeledit/colorcustomscreens.cpp +++ b/companion/src/modeledit/colorcustomscreens.cpp @@ -151,7 +151,7 @@ UserInterfacePanel::UserInterfacePanel(QWidget * parent, ModelData & model, Gene ZonePersistentData & zpd = model.topBarData.zones[i]; QPushButton * btn = new QPushButton(zpd.widgetName, this); btn->setProperty("index", i); - btn->setFixedSize(QSize(90, 30)); + btn->setFixedSize(QSize(180, 50)); widgetbtns.append(btn); if (zpd.widgetName[0] != '\0' && SHOW_RAW_INFO) { @@ -280,7 +280,7 @@ CustomScreenPanel::CustomScreenPanel(QWidget * parent, ModelData & model, int in ZonePersistentData & zpd = lpd.zones[i]; QPushButton * btn = new QPushButton(zpd.widgetName, this); btn->setProperty("index", i); - btn->setFixedSize(QSize(90, 30)); + btn->setFixedSize(QSize(180, 50)); widgetbtns.append(btn); if (zpd.widgetName[0] != '\0' && SHOW_RAW_INFO) { @@ -293,7 +293,7 @@ CustomScreenPanel::CustomScreenPanel(QWidget * parent, ModelData & model, int in wgt->setVisible(false); optswidgets.append(wgt); - QGridLayout * layout = new QGridLayout(wgt); // must be owned by QWidget so isibility can be set + QGridLayout * layout = new QGridLayout(wgt); // must be owned by QWidget so visibility can be set layout->addLayout(addOptionsLayout(zpd.widgetData, MAX_WIDGET_OPTIONS, zpd.widgetName), 0, 0, Qt::AlignTop); optsgrids.append(layout); diff --git a/radio/src/datastructs.h b/radio/src/datastructs.h index 87c18b981..4adf028f1 100644 --- a/radio/src/datastructs.h +++ b/radio/src/datastructs.h @@ -72,11 +72,11 @@ static inline void check_struct() CHKSIZE(LimitData, 13); CHKSIZE(TimerData, 17); CHKSIZE(ModelHeader, 131); - CHKSIZE(CustomScreenData, 1892); + CHKSIZE(CustomScreenData, 1972); #if defined(PCBNV14) || defined(RADIO_NB4P) || defined(RADIO_NV14_FAMILY) - CHKTYPE(TopBarPersistentData, 704); + CHKTYPE(TopBarPersistentData, 736); #else - CHKTYPE(TopBarPersistentData, 1048); + CHKTYPE(TopBarPersistentData, 1096); #endif #else #error CHKSIZE not set up @@ -106,18 +106,18 @@ static inline void check_struct() CHKSIZE(ModelData, 6329); #elif defined(PCBPL18) #if defined(RADIO_NB4P) || defined(RADIO_NV14_FAMILY) - CHKSIZE(ModelData, 26499); + CHKSIZE(ModelData, 27331); #else - CHKSIZE(ModelData, 26845); + CHKSIZE(ModelData, 27693); #endif #elif defined(PCBNV14) - CHKSIZE(ModelData, 26463); + CHKSIZE(ModelData, 27295); #elif defined(PCBST16) - CHKSIZE(ModelData, 26906); + CHKSIZE(ModelData, 27754); #elif defined(RADIO_T15) - CHKSIZE(ModelData, 26834); + CHKSIZE(ModelData, 27682); #elif defined(PCBHORUS) - CHKSIZE(ModelData, 26809); + CHKSIZE(ModelData, 27657); #else #error CHKSIZE not set up #endif diff --git a/radio/src/gui/colorlcd/mainview/widgets_container.h b/radio/src/gui/colorlcd/mainview/widgets_container.h index ec1add34b..905a88bca 100644 --- a/radio/src/gui/colorlcd/mainview/widgets_container.h +++ b/radio/src/gui/colorlcd/mainview/widgets_container.h @@ -24,7 +24,7 @@ #include "window.h" #include "zone.h" -#define WIDGET_NAME_LEN 12 +#define WIDGET_NAME_LEN 20 #define MAX_WIDGET_OPTIONS 10 static LAYOUT_VAL2(MAX_TOPBAR_ZONES, 6, 4) diff --git a/radio/src/storage/yaml/yaml_datastructs_f16.cpp b/radio/src/storage/yaml/yaml_datastructs_f16.cpp index 0c4ab6407..5cf35bf5d 100644 --- a/radio/src/storage/yaml/yaml_datastructs_f16.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_f16.cpp @@ -788,23 +788,23 @@ static const struct YamlNode struct_WidgetPersistentData[] = { }; static const struct YamlNode struct_ZonePersistentData[] = { YAML_IDX, - YAML_STRING("widgetName", 12), + YAML_STRING("widgetName", 20), YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL), YAML_END }; static const struct YamlNode struct_LayoutPersistentData[] = { - YAML_ARRAY("zones", 1376, 10, struct_ZonePersistentData, NULL), + YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL), YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL), YAML_END }; static const struct YamlNode struct_CustomScreenData[] = { YAML_IDX, YAML_STRING("LayoutId", 12), - YAML_STRUCT("layoutData", 15040, struct_LayoutPersistentData, NULL), + YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL), YAML_END }; static const struct YamlNode struct_TopBarPersistentData[] = { - YAML_ARRAY("zones", 1376, 6, struct_ZonePersistentData, NULL), + YAML_ARRAY("zones", 1440, 6, struct_ZonePersistentData, NULL), YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL), YAML_END }; @@ -869,8 +869,8 @@ static const struct YamlNode struct_ModelData[] = { YAML_UNSIGNED( "potsWarnEnabled", 16 ), YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL), YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL), - YAML_ARRAY("screenData", 15136, 10, struct_CustomScreenData, NULL), - YAML_STRUCT("topbarData", 8384, struct_TopBarPersistentData, NULL), + YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL), + YAML_STRUCT("topbarData", 8768, struct_TopBarPersistentData, NULL), YAML_ARRAY("topbarWidgetWidth", 8, 6, struct_unsigned_8, NULL), YAML_UNSIGNED( "view", 8 ), YAML_STRING("modelRegistrationID", 8), diff --git a/radio/src/storage/yaml/yaml_datastructs_nb4p.cpp b/radio/src/storage/yaml/yaml_datastructs_nb4p.cpp index 15197e9d4..eaeb6ef74 100644 --- a/radio/src/storage/yaml/yaml_datastructs_nb4p.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_nb4p.cpp @@ -779,23 +779,23 @@ static const struct YamlNode struct_WidgetPersistentData[] = { }; static const struct YamlNode struct_ZonePersistentData[] = { YAML_IDX, - YAML_STRING("widgetName", 12), + YAML_STRING("widgetName", 20), YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL), YAML_END }; static const struct YamlNode struct_LayoutPersistentData[] = { - YAML_ARRAY("zones", 1376, 10, struct_ZonePersistentData, NULL), + YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL), YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL), YAML_END }; static const struct YamlNode struct_CustomScreenData[] = { YAML_IDX, YAML_STRING("LayoutId", 12), - YAML_STRUCT("layoutData", 15040, struct_LayoutPersistentData, NULL), + YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL), YAML_END }; static const struct YamlNode struct_TopBarPersistentData[] = { - YAML_ARRAY("zones", 1376, 4, struct_ZonePersistentData, NULL), + YAML_ARRAY("zones", 1440, 4, struct_ZonePersistentData, NULL), YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL), YAML_END }; @@ -860,8 +860,8 @@ static const struct YamlNode struct_ModelData[] = { YAML_UNSIGNED( "potsWarnEnabled", 16 ), YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL), YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL), - YAML_ARRAY("screenData", 15136, 10, struct_CustomScreenData, NULL), - YAML_STRUCT("topbarData", 5632, struct_TopBarPersistentData, NULL), + YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL), + YAML_STRUCT("topbarData", 5888, struct_TopBarPersistentData, NULL), YAML_ARRAY("topbarWidgetWidth", 8, 4, struct_unsigned_8, NULL), YAML_UNSIGNED( "view", 8 ), YAML_STRING("modelRegistrationID", 8), diff --git a/radio/src/storage/yaml/yaml_datastructs_nv14_family.cpp b/radio/src/storage/yaml/yaml_datastructs_nv14_family.cpp index 34195f4c9..9cf8d4df1 100644 --- a/radio/src/storage/yaml/yaml_datastructs_nv14_family.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_nv14_family.cpp @@ -786,23 +786,23 @@ static const struct YamlNode struct_WidgetPersistentData[] = { }; static const struct YamlNode struct_ZonePersistentData[] = { YAML_IDX, - YAML_STRING("widgetName", 12), + YAML_STRING("widgetName", 20), YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL), YAML_END }; static const struct YamlNode struct_LayoutPersistentData[] = { - YAML_ARRAY("zones", 1376, 10, struct_ZonePersistentData, NULL), + YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL), YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL), YAML_END }; static const struct YamlNode struct_CustomScreenData[] = { YAML_IDX, YAML_STRING("LayoutId", 12), - YAML_STRUCT("layoutData", 15040, struct_LayoutPersistentData, NULL), + YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL), YAML_END }; static const struct YamlNode struct_TopBarPersistentData[] = { - YAML_ARRAY("zones", 1376, 4, struct_ZonePersistentData, NULL), + YAML_ARRAY("zones", 1440, 4, struct_ZonePersistentData, NULL), YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL), YAML_END }; @@ -868,8 +868,8 @@ static const struct YamlNode struct_ModelData[] = { YAML_UNSIGNED( "potsWarnEnabled", 16 ), YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL), YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL), - YAML_ARRAY("screenData", 15136, 10, struct_CustomScreenData, NULL), - YAML_STRUCT("topbarData", 5632, struct_TopBarPersistentData, NULL), + YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL), + YAML_STRUCT("topbarData", 5888, struct_TopBarPersistentData, NULL), YAML_ARRAY("topbarWidgetWidth", 8, 4, struct_unsigned_8, NULL), YAML_UNSIGNED( "view", 8 ), YAML_STRING("modelRegistrationID", 8), diff --git a/radio/src/storage/yaml/yaml_datastructs_st16.cpp b/radio/src/storage/yaml/yaml_datastructs_st16.cpp index ed55c8818..9a9f870be 100644 --- a/radio/src/storage/yaml/yaml_datastructs_st16.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_st16.cpp @@ -788,23 +788,23 @@ static const struct YamlNode struct_WidgetPersistentData[] = { }; static const struct YamlNode struct_ZonePersistentData[] = { YAML_IDX, - YAML_STRING("widgetName", 12), + YAML_STRING("widgetName", 20), YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL), YAML_END }; static const struct YamlNode struct_LayoutPersistentData[] = { - YAML_ARRAY("zones", 1376, 10, struct_ZonePersistentData, NULL), + YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL), YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL), YAML_END }; static const struct YamlNode struct_CustomScreenData[] = { YAML_IDX, YAML_STRING("LayoutId", 12), - YAML_STRUCT("layoutData", 15040, struct_LayoutPersistentData, NULL), + YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL), YAML_END }; static const struct YamlNode struct_TopBarPersistentData[] = { - YAML_ARRAY("zones", 1376, 6, struct_ZonePersistentData, NULL), + YAML_ARRAY("zones", 1440, 6, struct_ZonePersistentData, NULL), YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL), YAML_END }; @@ -881,8 +881,8 @@ static const struct YamlNode struct_ModelData[] = { YAML_UNSIGNED( "potsWarnEnabled", 16 ), YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL), YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL), - YAML_ARRAY("screenData", 15136, 10, struct_CustomScreenData, NULL), - YAML_STRUCT("topbarData", 8384, struct_TopBarPersistentData, NULL), + YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL), + YAML_STRUCT("topbarData", 8768, struct_TopBarPersistentData, NULL), YAML_ARRAY("topbarWidgetWidth", 8, 6, struct_unsigned_8, NULL), YAML_UNSIGNED( "view", 8 ), YAML_STRING("modelRegistrationID", 8), diff --git a/radio/src/storage/yaml/yaml_datastructs_t15.cpp b/radio/src/storage/yaml/yaml_datastructs_t15.cpp index 0ac5f7771..396c77bed 100644 --- a/radio/src/storage/yaml/yaml_datastructs_t15.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_t15.cpp @@ -788,23 +788,23 @@ static const struct YamlNode struct_WidgetPersistentData[] = { }; static const struct YamlNode struct_ZonePersistentData[] = { YAML_IDX, - YAML_STRING("widgetName", 12), + YAML_STRING("widgetName", 20), YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL), YAML_END }; static const struct YamlNode struct_LayoutPersistentData[] = { - YAML_ARRAY("zones", 1376, 10, struct_ZonePersistentData, NULL), + YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL), YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL), YAML_END }; static const struct YamlNode struct_CustomScreenData[] = { YAML_IDX, YAML_STRING("LayoutId", 12), - YAML_STRUCT("layoutData", 15040, struct_LayoutPersistentData, NULL), + YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL), YAML_END }; static const struct YamlNode struct_TopBarPersistentData[] = { - YAML_ARRAY("zones", 1376, 6, struct_ZonePersistentData, NULL), + YAML_ARRAY("zones", 1440, 6, struct_ZonePersistentData, NULL), YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL), YAML_END }; @@ -874,8 +874,8 @@ static const struct YamlNode struct_ModelData[] = { YAML_UNSIGNED( "potsWarnEnabled", 16 ), YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL), YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL), - YAML_ARRAY("screenData", 15136, 10, struct_CustomScreenData, NULL), - YAML_STRUCT("topbarData", 8384, struct_TopBarPersistentData, NULL), + YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL), + YAML_STRUCT("topbarData", 8768, struct_TopBarPersistentData, NULL), YAML_ARRAY("topbarWidgetWidth", 8, 6, struct_unsigned_8, NULL), YAML_UNSIGNED( "view", 8 ), YAML_STRING("modelRegistrationID", 8), diff --git a/radio/src/storage/yaml/yaml_datastructs_x10.cpp b/radio/src/storage/yaml/yaml_datastructs_x10.cpp index f45ca1160..733b3dc59 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x10.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x10.cpp @@ -787,23 +787,23 @@ static const struct YamlNode struct_WidgetPersistentData[] = { }; static const struct YamlNode struct_ZonePersistentData[] = { YAML_IDX, - YAML_STRING("widgetName", 12), + YAML_STRING("widgetName", 20), YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL), YAML_END }; static const struct YamlNode struct_LayoutPersistentData[] = { - YAML_ARRAY("zones", 1376, 10, struct_ZonePersistentData, NULL), + YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL), YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL), YAML_END }; static const struct YamlNode struct_CustomScreenData[] = { YAML_IDX, YAML_STRING("LayoutId", 12), - YAML_STRUCT("layoutData", 15040, struct_LayoutPersistentData, NULL), + YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL), YAML_END }; static const struct YamlNode struct_TopBarPersistentData[] = { - YAML_ARRAY("zones", 1376, 6, struct_ZonePersistentData, NULL), + YAML_ARRAY("zones", 1440, 6, struct_ZonePersistentData, NULL), YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL), YAML_END }; @@ -868,8 +868,8 @@ static const struct YamlNode struct_ModelData[] = { YAML_UNSIGNED( "potsWarnEnabled", 16 ), YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL), YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL), - YAML_ARRAY("screenData", 15136, 10, struct_CustomScreenData, NULL), - YAML_STRUCT("topbarData", 8384, struct_TopBarPersistentData, NULL), + YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL), + YAML_STRUCT("topbarData", 8768, struct_TopBarPersistentData, NULL), YAML_ARRAY("topbarWidgetWidth", 8, 6, struct_unsigned_8, NULL), YAML_UNSIGNED( "view", 8 ), YAML_STRING("modelRegistrationID", 8),