fix(color): rename 6x1 layout for consistency and add to Companion (#7055)
This commit is contained in:
@@ -1063,6 +1063,7 @@
|
||||
<file alias="mask_layout1x2.png">images/layouts/mask_layout1x2.png</file>
|
||||
<file alias="mask_layout1x3.png">images/layouts/mask_layout1x3.png</file>
|
||||
<file alias="mask_layout1x4.png">images/layouts/mask_layout1x4.png</file>
|
||||
<file alias="mask_layout1x6.png">images/layouts/mask_layout1x6.png</file>
|
||||
<file alias="mask_layout2p1.png">images/layouts/mask_layout2+1.png</file>
|
||||
<file alias="mask_layout2p3.png">images/layouts/mask_layout2+3.png</file>
|
||||
<file alias="mask_layout2x1.png">images/layouts/mask_layout2x1.png</file>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
+8
-10
@@ -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("Layout6x1", "6 x 1", OPTIONS_LAYOUT_6x1,
|
||||
BaseLayoutFactory<Layout6x1> layout1x6("Layout1x6", "1 x 6", OPTIONS_LAYOUT_6x1,
|
||||
6, (uint8_t*)zmap);
|
||||
@@ -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
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -565,7 +565,11 @@ void r_screen_id(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
auto tw = reinterpret_cast<YamlTreeWalker*>(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,
|
||||
|
||||
Reference in New Issue
Block a user