Skip to content

Commit 75c4268

Browse files
author
philmoz
committedApr 3, 2025
Fix analog diag page layout. Fix customisable switch edit page layout.
1 parent 74c1c15 commit 75c4268

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed
 

‎radio/src/gui/colorlcd/model/function_switches.cpp

+20-21
Original file line numberDiff line numberDiff line change
@@ -169,30 +169,29 @@ class FunctionSwitch : public Window
169169
}
170170

171171
#if defined(FUNCTION_SWITCHES_RGB_LEDS)
172-
static constexpr coord_t SW_X = PAD_SMALL;
173-
static constexpr coord_t SW_W = 70;
174-
static constexpr coord_t NM_X = SW_X + SW_W;
175-
static constexpr coord_t NM_W = 60;
172+
static LAYOUT_VAL(SW_W, 70, 70, LS(70))
173+
static constexpr coord_t NM_X = SW_W + PAD_SMALL;
174+
static LAYOUT_VAL(NM_W, 60, 60, LS(60))
176175
static constexpr coord_t TP_X = NM_X + NM_W + PAD_SMALL;
177-
static constexpr coord_t TP_W = 78;
176+
static LAYOUT_VAL(TP_W, 78, 78, LS(78))
178177
static constexpr coord_t GR_X = TP_X + TP_W + PAD_SMALL;
179-
static constexpr coord_t GR_W = 84;
178+
static LAYOUT_VAL(GR_W, 84, 84, LS(84))
180179
static constexpr coord_t ST_X = GR_X + GR_W + PAD_SMALL;
181-
static constexpr coord_t ST_W = 60;
180+
static LAYOUT_VAL(ST_W, 60, 60, LS(60))
182181
static constexpr coord_t C1_X = ST_X + ST_W + PAD_SMALL;
183-
static constexpr coord_t C1_W = 40;
182+
static LAYOUT_VAL(C1_W, 40, 40, LS(40))
184183
static constexpr coord_t C2_X = C1_X + C1_W + PAD_SMALL;
185-
static constexpr coord_t C2_W = 40;
184+
static LAYOUT_VAL(C2_W, 40, 40, LS(40))
186185
#else
187186
static constexpr coord_t SW_W = (LCD_W - PAD_SMALL * 2 - PAD_TINY * 4) / 5;
188187
static constexpr coord_t NM_X = SW_W + PAD_TINY;
189-
static constexpr coord_t NM_W = 80;
188+
static LAYOUT_VAL(NM_W, 80, 80, LS(80))
190189
static constexpr coord_t TP_X = NM_X + SW_W + PAD_TINY;
191-
static constexpr coord_t TP_W = 86;
190+
static LAYOUT_VAL(TP_W, 86, 86, LS(86))
192191
static constexpr coord_t GR_X = TP_X + SW_W + PAD_TINY;
193-
static constexpr coord_t GR_W = 94;
194-
static constexpr coord_t ST_X = GR_X + SW_W + 20;
195-
static constexpr coord_t ST_W = 70;
192+
static LAYOUT_VAL(GR_W, 94, 94, LS(94))
193+
static constexpr coord_t ST_X = GR_X + SW_W + PAD_LARGE * 2 + PAD_SMALL;
194+
static LAYOUT_VAL(ST_W, 70, 70, LS(70))
196195
#endif
197196

198197
protected:
@@ -295,13 +294,13 @@ class SwitchGroup : public Window
295294
startChoice->setValue(groupDefaultSwitch(groupIndex) + 1);
296295
}
297296

298-
static constexpr coord_t NM_W = 100;
299-
static constexpr coord_t AO_X = NM_W + 2;
300-
static constexpr coord_t AO_W = 100;
301-
static constexpr coord_t SL_X = AO_X + AO_W + 30;
302-
static constexpr coord_t SL_W = 100;
303-
static constexpr coord_t ST_X = SL_X + SL_W + 2;
304-
static constexpr coord_t ST_W = 80;
297+
static LAYOUT_VAL(NM_W, 100, 100, LS(100))
298+
static constexpr coord_t AO_X = NM_W + PAD_TINY;
299+
static LAYOUT_VAL(AO_W, 100, 100, LS(100))
300+
static constexpr coord_t SL_X = AO_X + AO_W + PAD_LARGE * 3 + PAD_MEDIUM;
301+
static LAYOUT_VAL(SL_W, 100, 100, LS(100))
302+
static constexpr coord_t ST_X = SL_X + SL_W + PAD_TINY;
303+
static LAYOUT_VAL(ST_W, 80, 80, LS(80))
305304

306305
protected:
307306
uint8_t groupIndex;

‎radio/src/gui/colorlcd/radio/radio_diaganas.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@
3535
#if !PORTRAIT_LCD
3636

3737
static const lv_coord_t col_dsc[] = {
38-
LV_GRID_FR(30), LV_GRID_FR(30), LV_GRID_FR(40), LV_GRID_FR(40),
39-
LV_GRID_FR(40), LV_GRID_FR(30), LV_GRID_FR(30), LV_GRID_FR(40),
40-
LV_GRID_FR(40), LV_GRID_FR(40), LV_GRID_TEMPLATE_LAST};
38+
LV_GRID_FR(32), LV_GRID_FR(40), LV_GRID_FR(40), LV_GRID_FR(40), LV_GRID_FR(40),
39+
LV_GRID_FR(32), LV_GRID_FR(40), LV_GRID_FR(40), LV_GRID_FR(40), LV_GRID_FR(40),
40+
LV_GRID_TEMPLATE_LAST
41+
};
4142

4243
#else
4344

0 commit comments

Comments
 (0)