From 99013f7e0d0bd905ab65e82e86025d27036486ac Mon Sep 17 00:00:00 2001 From: philmoz Date: Sun, 1 Feb 2026 08:44:26 +1100 Subject: [PATCH] fix(color): rename 6x1 layout for consistency and add to Companion (#7055) --- companion/src/companion.qrc | 1 + .../src/images/layouts/mask_layout1x6.png | Bin 0 -> 1430 bytes .../layouts/{layout6x1.cpp => layout1x6.cpp} | 18 ++++++++---------- radio/src/gui/colorlcd/mainview/layout.h | 16 +++++++++++----- .../storage/yaml/yaml_datastructs_funcs.cpp | 6 +++++- 5 files changed, 25 insertions(+), 16 deletions(-) create mode 100644 companion/src/images/layouts/mask_layout1x6.png rename radio/src/gui/colorlcd/layouts/{layout6x1.cpp => layout1x6.cpp} (78%) diff --git a/companion/src/companion.qrc b/companion/src/companion.qrc index d41eef107..941804319 100644 --- a/companion/src/companion.qrc +++ b/companion/src/companion.qrc @@ -1063,6 +1063,7 @@ images/layouts/mask_layout1x2.png images/layouts/mask_layout1x3.png images/layouts/mask_layout1x4.png + images/layouts/mask_layout1x6.png images/layouts/mask_layout2+1.png images/layouts/mask_layout2+3.png images/layouts/mask_layout2x1.png diff --git a/companion/src/images/layouts/mask_layout1x6.png b/companion/src/images/layouts/mask_layout1x6.png new file mode 100644 index 0000000000000000000000000000000000000000..92f7b70fbe472af56439bf86a4debc15a7742a63 GIT binary patch literal 1430 zcmbVM-D?zA6knweY8#OT6n)TP(ub6EX70?o17W7pRd=R8yMfxIm?tVr5yO)(m4;{o~F(RSA7py-@Oym&~zNSlvw7%I0F7 zZmv_uSEtV@XS)~#L`)E+8@1yMcU`qF7sFg`8>-TWh;>(;kqVVnZ%LWsDN`KX)F?tl z<&2{{wu4CdOhCU-EM%1oR5XySSqPU9Hf?42sGuW7^;JntG0wluwisM9lcZ3 zdD=8g$8ii~8J491Ld$xwAYCoaCPoq}ETd_dh>*vMlt>zUL%1p!J75tdx!5=xdJ24I zbV*{EI+CpVK%eHgWFu|&mHX6SZ5FXuWPmkuY|`R_XD$8~(fRQ|6o7XgHh&4soRDl1JeM*ecv|PYJ&M)R$YjN`b<^Ype_@bJ{8eTBB?e%?YeBYuGjld^);c;dDa=cXZ!>&--7eA=DRXf3O@`buue( zHOwGhy6KfC-fe?y6Kqmig*%JN#e|48(R?421qixCgL|2ckn#Hq!)e zy-P+JV80=&aX`iRH_QInuF4(3p&iI+-ilz6H!~JP2TP$XxpMyZ*PX@Y&aL_j@BWqTtDhCek3ZgicK7gKM_#voUVAz}z4qs|-mkwryvx3Q i`D2M+KPI=2-u~FS`RS>XKdDb-=d8^yR(_cM?)x|D;Kj%Q literal 0 HcmV?d00001 diff --git a/radio/src/gui/colorlcd/layouts/layout6x1.cpp b/radio/src/gui/colorlcd/layouts/layout1x6.cpp similarity index 78% rename from radio/src/gui/colorlcd/layouts/layout6x1.cpp rename to radio/src/gui/colorlcd/layouts/layout1x6.cpp index 91101ccae..634b2009a 100644 --- a/radio/src/gui/colorlcd/layouts/layout6x1.cpp +++ b/radio/src/gui/colorlcd/layouts/layout1x6.cpp @@ -77,21 +77,19 @@ class Layout6x1 : public Layout } }; -// Zone map: 6x1 (6 rows, 1 column) +// Zone map: 6x1 (1 column, 6 rows) // Each zone is 1/6 height, full width -#define LAYOUT_MAP_1_6TH 10 // 1/6 of full dimension (60/6 = 10) - // clang-format off static const uint8_t zmap[] = { // Zone positions: x, y, w, h - LAYOUT_MAP_0, LAYOUT_MAP_0, LAYOUT_MAP_FULL, LAYOUT_MAP_1_6TH, // Zone 1 - LAYOUT_MAP_0, LAYOUT_MAP_1_6TH, LAYOUT_MAP_FULL, LAYOUT_MAP_1_6TH, // Zone 2 - LAYOUT_MAP_0, LAYOUT_MAP_1_6TH*2,LAYOUT_MAP_FULL, LAYOUT_MAP_1_6TH, // Zone 3 - LAYOUT_MAP_0, LAYOUT_MAP_1_6TH*3,LAYOUT_MAP_FULL, LAYOUT_MAP_1_6TH, // Zone 4 - LAYOUT_MAP_0, LAYOUT_MAP_1_6TH*4,LAYOUT_MAP_FULL, LAYOUT_MAP_1_6TH, // Zone 5 - LAYOUT_MAP_0, LAYOUT_MAP_1_6TH*5,LAYOUT_MAP_FULL, LAYOUT_MAP_1_6TH, // Zone 6 + LAYOUT_MAP_0, LAYOUT_MAP_0, LAYOUT_MAP_FULL, LAYOUT_MAP_1SIXTH, // Zone 1 + LAYOUT_MAP_0, LAYOUT_MAP_1SIXTH, LAYOUT_MAP_FULL, LAYOUT_MAP_1SIXTH, // Zone 2 + LAYOUT_MAP_0, LAYOUT_MAP_1THIRD, LAYOUT_MAP_FULL, LAYOUT_MAP_1SIXTH, // Zone 3 + LAYOUT_MAP_0, LAYOUT_MAP_HALF, LAYOUT_MAP_FULL, LAYOUT_MAP_1SIXTH, // Zone 4 + LAYOUT_MAP_0, LAYOUT_MAP_2THIRD, LAYOUT_MAP_FULL, LAYOUT_MAP_1SIXTH, // Zone 5 + LAYOUT_MAP_0, LAYOUT_MAP_5SIXTH, LAYOUT_MAP_FULL, LAYOUT_MAP_1SIXTH, // Zone 6 }; // clang-format on -BaseLayoutFactory layout6x1("Layout6x1", "6 x 1", OPTIONS_LAYOUT_6x1, +BaseLayoutFactory layout1x6("Layout1x6", "1 x 6", OPTIONS_LAYOUT_6x1, 6, (uint8_t*)zmap); diff --git a/radio/src/gui/colorlcd/mainview/layout.h b/radio/src/gui/colorlcd/mainview/layout.h index 7c4b9a247..0c3a7f246 100644 --- a/radio/src/gui/colorlcd/mainview/layout.h +++ b/radio/src/gui/colorlcd/mainview/layout.h @@ -73,11 +73,17 @@ extern const LayoutOption defaultLayoutOptions[]; #define LAYOUT_MAP_DIV 60 #define LAYOUT_MAP_0 0 -#define LAYOUT_MAP_1QTR 15 -#define LAYOUT_MAP_1THIRD 20 -#define LAYOUT_MAP_HALF 30 -#define LAYOUT_MAP_2THIRD 40 -#define LAYOUT_MAP_3QTR 45 +#define LAYOUT_MAP_1SIXTH 10 // 1/6 +#define LAYOUT_MAP_1FIFTH 12 // 1/5 +#define LAYOUT_MAP_1QTR 15 // 1/4 +#define LAYOUT_MAP_2FIFTH 24 // 2/5 +#define LAYOUT_MAP_1THIRD 20 // 1/3 +#define LAYOUT_MAP_HALF 30 // 1/2 +#define LAYOUT_MAP_3FIFTH 36 // 3/5 +#define LAYOUT_MAP_2THIRD 40 // 2/3 +#define LAYOUT_MAP_3QTR 45 // 3/4 +#define LAYOUT_MAP_4FIFTH 48 // 4/5 +#define LAYOUT_MAP_5SIXTH 50 // 5/6 #define LAYOUT_MAP_FULL 60 //----------------------------------------------------------------------------- diff --git a/radio/src/storage/yaml/yaml_datastructs_funcs.cpp b/radio/src/storage/yaml/yaml_datastructs_funcs.cpp index 7f8eee708..21ff6e177 100644 --- a/radio/src/storage/yaml/yaml_datastructs_funcs.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_funcs.cpp @@ -565,7 +565,11 @@ void r_screen_id(void* user, uint8_t* data, uint32_t bitoffs, auto tw = reinterpret_cast(user); auto screenData = g_model.getScreenData(tw->getElmts(1)); - screenData->LayoutId = val; + // Convert renamed layout (TODO: remove in the future) + if (strncmp(val, "Layout6x1", 9) == 0) + screenData->LayoutId ="Layout1x6"; + else + screenData->LayoutId = val; } bool w_screen_id(void* user, uint8_t* data, uint32_t bitoffs,