Skip to content

Commit f22baf6

Browse files
authored
feat(color): increase max length for widget name (#6099)
1 parent 91f9715 commit f22baf6

10 files changed

+50
-50
lines changed

companion/src/firmwares/customisation_data.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ constexpr int MAX_THEME_OPTIONS {5};
3636
constexpr int LEN_ZONE_OPTION_STRING {8};
3737
constexpr int MAX_LAYOUT_ZONES {10};
3838
constexpr int MAX_LAYOUT_OPTIONS {10};
39-
constexpr int WIDGET_NAME_LEN {12};
39+
constexpr int WIDGET_NAME_LEN {20};
4040
constexpr int MAX_WIDGET_OPTIONS {5};
4141
constexpr int MAX_TOPBAR_ZONES {6}; // max 4 used for portrait
4242
constexpr int MAX_TOPBAR_OPTIONS {1};

companion/src/modeledit/colorcustomscreens.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ UserInterfacePanel::UserInterfacePanel(QWidget * parent, ModelData & model, Gene
151151
ZonePersistentData & zpd = model.topBarData.zones[i];
152152
QPushButton * btn = new QPushButton(zpd.widgetName, this);
153153
btn->setProperty("index", i);
154-
btn->setFixedSize(QSize(90, 30));
154+
btn->setFixedSize(QSize(180, 50));
155155
widgetbtns.append(btn);
156156

157157
if (zpd.widgetName[0] != '\0' && SHOW_RAW_INFO) {
@@ -280,7 +280,7 @@ CustomScreenPanel::CustomScreenPanel(QWidget * parent, ModelData & model, int in
280280
ZonePersistentData & zpd = lpd.zones[i];
281281
QPushButton * btn = new QPushButton(zpd.widgetName, this);
282282
btn->setProperty("index", i);
283-
btn->setFixedSize(QSize(90, 30));
283+
btn->setFixedSize(QSize(180, 50));
284284
widgetbtns.append(btn);
285285

286286
if (zpd.widgetName[0] != '\0' && SHOW_RAW_INFO) {
@@ -293,7 +293,7 @@ CustomScreenPanel::CustomScreenPanel(QWidget * parent, ModelData & model, int in
293293
wgt->setVisible(false);
294294
optswidgets.append(wgt);
295295

296-
QGridLayout * layout = new QGridLayout(wgt); // must be owned by QWidget so isibility can be set
296+
QGridLayout * layout = new QGridLayout(wgt); // must be owned by QWidget so visibility can be set
297297
layout->addLayout(addOptionsLayout<WidgetPersistentData>(zpd.widgetData, MAX_WIDGET_OPTIONS, zpd.widgetName), 0, 0, Qt::AlignTop);
298298
optsgrids.append(layout);
299299

radio/src/datastructs.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ static inline void check_struct()
7272
CHKSIZE(LimitData, 13);
7373
CHKSIZE(TimerData, 17);
7474
CHKSIZE(ModelHeader, 131);
75-
CHKSIZE(CustomScreenData, 1892);
75+
CHKSIZE(CustomScreenData, 1972);
7676
#if defined(PCBNV14) || defined(RADIO_NB4P) || defined(RADIO_NV14_FAMILY)
77-
CHKTYPE(TopBarPersistentData, 704);
77+
CHKTYPE(TopBarPersistentData, 736);
7878
#else
79-
CHKTYPE(TopBarPersistentData, 1048);
79+
CHKTYPE(TopBarPersistentData, 1096);
8080
#endif
8181
#else
8282
#error CHKSIZE not set up
@@ -106,18 +106,18 @@ static inline void check_struct()
106106
CHKSIZE(ModelData, 6329);
107107
#elif defined(PCBPL18)
108108
#if defined(RADIO_NB4P) || defined(RADIO_NV14_FAMILY)
109-
CHKSIZE(ModelData, 26499);
109+
CHKSIZE(ModelData, 27331);
110110
#else
111-
CHKSIZE(ModelData, 26845);
111+
CHKSIZE(ModelData, 27693);
112112
#endif
113113
#elif defined(PCBNV14)
114-
CHKSIZE(ModelData, 26463);
114+
CHKSIZE(ModelData, 27295);
115115
#elif defined(PCBST16)
116-
CHKSIZE(ModelData, 26906);
116+
CHKSIZE(ModelData, 27754);
117117
#elif defined(RADIO_T15)
118-
CHKSIZE(ModelData, 26834);
118+
CHKSIZE(ModelData, 27682);
119119
#elif defined(PCBHORUS)
120-
CHKSIZE(ModelData, 26809);
120+
CHKSIZE(ModelData, 27657);
121121
#else
122122
#error CHKSIZE not set up
123123
#endif

radio/src/gui/colorlcd/mainview/widgets_container.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "window.h"
2525
#include "zone.h"
2626

27-
#define WIDGET_NAME_LEN 12
27+
#define WIDGET_NAME_LEN 20
2828
#define MAX_WIDGET_OPTIONS 10
2929

3030
static LAYOUT_VAL2(MAX_TOPBAR_ZONES, 6, 4)

radio/src/storage/yaml/yaml_datastructs_f16.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -788,23 +788,23 @@ static const struct YamlNode struct_WidgetPersistentData[] = {
788788
};
789789
static const struct YamlNode struct_ZonePersistentData[] = {
790790
YAML_IDX,
791-
YAML_STRING("widgetName", 12),
791+
YAML_STRING("widgetName", 20),
792792
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
793793
YAML_END
794794
};
795795
static const struct YamlNode struct_LayoutPersistentData[] = {
796-
YAML_ARRAY("zones", 1376, 10, struct_ZonePersistentData, NULL),
796+
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
797797
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
798798
YAML_END
799799
};
800800
static const struct YamlNode struct_CustomScreenData[] = {
801801
YAML_IDX,
802802
YAML_STRING("LayoutId", 12),
803-
YAML_STRUCT("layoutData", 15040, struct_LayoutPersistentData, NULL),
803+
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
804804
YAML_END
805805
};
806806
static const struct YamlNode struct_TopBarPersistentData[] = {
807-
YAML_ARRAY("zones", 1376, 6, struct_ZonePersistentData, NULL),
807+
YAML_ARRAY("zones", 1440, 6, struct_ZonePersistentData, NULL),
808808
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
809809
YAML_END
810810
};
@@ -869,8 +869,8 @@ static const struct YamlNode struct_ModelData[] = {
869869
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
870870
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
871871
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
872-
YAML_ARRAY("screenData", 15136, 10, struct_CustomScreenData, NULL),
873-
YAML_STRUCT("topbarData", 8384, struct_TopBarPersistentData, NULL),
872+
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
873+
YAML_STRUCT("topbarData", 8768, struct_TopBarPersistentData, NULL),
874874
YAML_ARRAY("topbarWidgetWidth", 8, 6, struct_unsigned_8, NULL),
875875
YAML_UNSIGNED( "view", 8 ),
876876
YAML_STRING("modelRegistrationID", 8),

radio/src/storage/yaml/yaml_datastructs_nb4p.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -779,23 +779,23 @@ static const struct YamlNode struct_WidgetPersistentData[] = {
779779
};
780780
static const struct YamlNode struct_ZonePersistentData[] = {
781781
YAML_IDX,
782-
YAML_STRING("widgetName", 12),
782+
YAML_STRING("widgetName", 20),
783783
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
784784
YAML_END
785785
};
786786
static const struct YamlNode struct_LayoutPersistentData[] = {
787-
YAML_ARRAY("zones", 1376, 10, struct_ZonePersistentData, NULL),
787+
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
788788
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
789789
YAML_END
790790
};
791791
static const struct YamlNode struct_CustomScreenData[] = {
792792
YAML_IDX,
793793
YAML_STRING("LayoutId", 12),
794-
YAML_STRUCT("layoutData", 15040, struct_LayoutPersistentData, NULL),
794+
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
795795
YAML_END
796796
};
797797
static const struct YamlNode struct_TopBarPersistentData[] = {
798-
YAML_ARRAY("zones", 1376, 4, struct_ZonePersistentData, NULL),
798+
YAML_ARRAY("zones", 1440, 4, struct_ZonePersistentData, NULL),
799799
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
800800
YAML_END
801801
};
@@ -860,8 +860,8 @@ static const struct YamlNode struct_ModelData[] = {
860860
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
861861
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
862862
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
863-
YAML_ARRAY("screenData", 15136, 10, struct_CustomScreenData, NULL),
864-
YAML_STRUCT("topbarData", 5632, struct_TopBarPersistentData, NULL),
863+
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
864+
YAML_STRUCT("topbarData", 5888, struct_TopBarPersistentData, NULL),
865865
YAML_ARRAY("topbarWidgetWidth", 8, 4, struct_unsigned_8, NULL),
866866
YAML_UNSIGNED( "view", 8 ),
867867
YAML_STRING("modelRegistrationID", 8),

radio/src/storage/yaml/yaml_datastructs_nv14_family.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -786,23 +786,23 @@ static const struct YamlNode struct_WidgetPersistentData[] = {
786786
};
787787
static const struct YamlNode struct_ZonePersistentData[] = {
788788
YAML_IDX,
789-
YAML_STRING("widgetName", 12),
789+
YAML_STRING("widgetName", 20),
790790
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
791791
YAML_END
792792
};
793793
static const struct YamlNode struct_LayoutPersistentData[] = {
794-
YAML_ARRAY("zones", 1376, 10, struct_ZonePersistentData, NULL),
794+
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
795795
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
796796
YAML_END
797797
};
798798
static const struct YamlNode struct_CustomScreenData[] = {
799799
YAML_IDX,
800800
YAML_STRING("LayoutId", 12),
801-
YAML_STRUCT("layoutData", 15040, struct_LayoutPersistentData, NULL),
801+
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
802802
YAML_END
803803
};
804804
static const struct YamlNode struct_TopBarPersistentData[] = {
805-
YAML_ARRAY("zones", 1376, 4, struct_ZonePersistentData, NULL),
805+
YAML_ARRAY("zones", 1440, 4, struct_ZonePersistentData, NULL),
806806
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
807807
YAML_END
808808
};
@@ -868,8 +868,8 @@ static const struct YamlNode struct_ModelData[] = {
868868
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
869869
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
870870
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
871-
YAML_ARRAY("screenData", 15136, 10, struct_CustomScreenData, NULL),
872-
YAML_STRUCT("topbarData", 5632, struct_TopBarPersistentData, NULL),
871+
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
872+
YAML_STRUCT("topbarData", 5888, struct_TopBarPersistentData, NULL),
873873
YAML_ARRAY("topbarWidgetWidth", 8, 4, struct_unsigned_8, NULL),
874874
YAML_UNSIGNED( "view", 8 ),
875875
YAML_STRING("modelRegistrationID", 8),

radio/src/storage/yaml/yaml_datastructs_st16.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -788,23 +788,23 @@ static const struct YamlNode struct_WidgetPersistentData[] = {
788788
};
789789
static const struct YamlNode struct_ZonePersistentData[] = {
790790
YAML_IDX,
791-
YAML_STRING("widgetName", 12),
791+
YAML_STRING("widgetName", 20),
792792
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
793793
YAML_END
794794
};
795795
static const struct YamlNode struct_LayoutPersistentData[] = {
796-
YAML_ARRAY("zones", 1376, 10, struct_ZonePersistentData, NULL),
796+
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
797797
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
798798
YAML_END
799799
};
800800
static const struct YamlNode struct_CustomScreenData[] = {
801801
YAML_IDX,
802802
YAML_STRING("LayoutId", 12),
803-
YAML_STRUCT("layoutData", 15040, struct_LayoutPersistentData, NULL),
803+
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
804804
YAML_END
805805
};
806806
static const struct YamlNode struct_TopBarPersistentData[] = {
807-
YAML_ARRAY("zones", 1376, 6, struct_ZonePersistentData, NULL),
807+
YAML_ARRAY("zones", 1440, 6, struct_ZonePersistentData, NULL),
808808
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
809809
YAML_END
810810
};
@@ -881,8 +881,8 @@ static const struct YamlNode struct_ModelData[] = {
881881
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
882882
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
883883
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
884-
YAML_ARRAY("screenData", 15136, 10, struct_CustomScreenData, NULL),
885-
YAML_STRUCT("topbarData", 8384, struct_TopBarPersistentData, NULL),
884+
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
885+
YAML_STRUCT("topbarData", 8768, struct_TopBarPersistentData, NULL),
886886
YAML_ARRAY("topbarWidgetWidth", 8, 6, struct_unsigned_8, NULL),
887887
YAML_UNSIGNED( "view", 8 ),
888888
YAML_STRING("modelRegistrationID", 8),

radio/src/storage/yaml/yaml_datastructs_t15.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -788,23 +788,23 @@ static const struct YamlNode struct_WidgetPersistentData[] = {
788788
};
789789
static const struct YamlNode struct_ZonePersistentData[] = {
790790
YAML_IDX,
791-
YAML_STRING("widgetName", 12),
791+
YAML_STRING("widgetName", 20),
792792
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
793793
YAML_END
794794
};
795795
static const struct YamlNode struct_LayoutPersistentData[] = {
796-
YAML_ARRAY("zones", 1376, 10, struct_ZonePersistentData, NULL),
796+
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
797797
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
798798
YAML_END
799799
};
800800
static const struct YamlNode struct_CustomScreenData[] = {
801801
YAML_IDX,
802802
YAML_STRING("LayoutId", 12),
803-
YAML_STRUCT("layoutData", 15040, struct_LayoutPersistentData, NULL),
803+
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
804804
YAML_END
805805
};
806806
static const struct YamlNode struct_TopBarPersistentData[] = {
807-
YAML_ARRAY("zones", 1376, 6, struct_ZonePersistentData, NULL),
807+
YAML_ARRAY("zones", 1440, 6, struct_ZonePersistentData, NULL),
808808
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
809809
YAML_END
810810
};
@@ -874,8 +874,8 @@ static const struct YamlNode struct_ModelData[] = {
874874
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
875875
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
876876
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
877-
YAML_ARRAY("screenData", 15136, 10, struct_CustomScreenData, NULL),
878-
YAML_STRUCT("topbarData", 8384, struct_TopBarPersistentData, NULL),
877+
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
878+
YAML_STRUCT("topbarData", 8768, struct_TopBarPersistentData, NULL),
879879
YAML_ARRAY("topbarWidgetWidth", 8, 6, struct_unsigned_8, NULL),
880880
YAML_UNSIGNED( "view", 8 ),
881881
YAML_STRING("modelRegistrationID", 8),

radio/src/storage/yaml/yaml_datastructs_x10.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -787,23 +787,23 @@ static const struct YamlNode struct_WidgetPersistentData[] = {
787787
};
788788
static const struct YamlNode struct_ZonePersistentData[] = {
789789
YAML_IDX,
790-
YAML_STRING("widgetName", 12),
790+
YAML_STRING("widgetName", 20),
791791
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
792792
YAML_END
793793
};
794794
static const struct YamlNode struct_LayoutPersistentData[] = {
795-
YAML_ARRAY("zones", 1376, 10, struct_ZonePersistentData, NULL),
795+
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
796796
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
797797
YAML_END
798798
};
799799
static const struct YamlNode struct_CustomScreenData[] = {
800800
YAML_IDX,
801801
YAML_STRING("LayoutId", 12),
802-
YAML_STRUCT("layoutData", 15040, struct_LayoutPersistentData, NULL),
802+
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
803803
YAML_END
804804
};
805805
static const struct YamlNode struct_TopBarPersistentData[] = {
806-
YAML_ARRAY("zones", 1376, 6, struct_ZonePersistentData, NULL),
806+
YAML_ARRAY("zones", 1440, 6, struct_ZonePersistentData, NULL),
807807
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
808808
YAML_END
809809
};
@@ -868,8 +868,8 @@ static const struct YamlNode struct_ModelData[] = {
868868
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
869869
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
870870
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
871-
YAML_ARRAY("screenData", 15136, 10, struct_CustomScreenData, NULL),
872-
YAML_STRUCT("topbarData", 8384, struct_TopBarPersistentData, NULL),
871+
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
872+
YAML_STRUCT("topbarData", 8768, struct_TopBarPersistentData, NULL),
873873
YAML_ARRAY("topbarWidgetWidth", 8, 6, struct_unsigned_8, NULL),
874874
YAML_UNSIGNED( "view", 8 ),
875875
YAML_STRING("modelRegistrationID", 8),

0 commit comments

Comments
 (0)