diff --git a/radio/src/gui/colorlcd/libui/etx_lv_theme.cpp b/radio/src/gui/colorlcd/libui/etx_lv_theme.cpp index 029537a5e55..eed9f90d055 100644 --- a/radio/src/gui/colorlcd/libui/etx_lv_theme.cpp +++ b/radio/src/gui/colorlcd/libui/etx_lv_theme.cpp @@ -107,16 +107,6 @@ const lv_style_const_prop_t pad_tiny_props[] = { }; LV_STYLE_CONST_MULTI_INIT(EdgeTxStyles::pad_tiny, pad_tiny_props); -#if LANDSCAPE_LCD_SMALL -const lv_style_const_prop_t pad_tiny_gap_props[] = { - LV_STYLE_CONST_PAD_TOP(PAD_TINY_GAP), LV_STYLE_CONST_PAD_BOTTOM(PAD_TINY_GAP), - LV_STYLE_CONST_PAD_LEFT(PAD_TINY_GAP), LV_STYLE_CONST_PAD_RIGHT(PAD_TINY_GAP), - LV_STYLE_CONST_PAD_ROW(PAD_TINY_GAP), LV_STYLE_CONST_PAD_COLUMN(PAD_TINY_GAP), - LV_STYLE_PROP_INV, -}; -LV_STYLE_CONST_MULTI_INIT(EdgeTxStyles::pad_tiny_gap, pad_tiny_gap_props); -#endif - const lv_style_const_prop_t pad_small_props[] = { LV_STYLE_CONST_PAD_TOP(PAD_SMALL), LV_STYLE_CONST_PAD_BOTTOM(PAD_SMALL), @@ -195,7 +185,7 @@ const lv_style_const_prop_t border_thin_props[] = { LV_STYLE_CONST_MULTI_INIT(EdgeTxStyles::border_thin, border_thin_props); static const lv_style_const_prop_t outline_props[] = { - LV_STYLE_CONST_OUTLINE_WIDTH(2), + LV_STYLE_CONST_OUTLINE_WIDTH(PAD_TINY), LV_STYLE_CONST_OUTLINE_OPA(LV_OPA_COVER), LV_STYLE_CONST_OUTLINE_PAD(1), LV_STYLE_PROP_INV, @@ -557,20 +547,12 @@ void etx_padding(lv_obj_t* obj, PaddingSize padding, lv_style_selector_t selector) { lv_obj_remove_style(obj, (lv_style_t*)&styles->pad_tiny, selector); -#if LANDSCAPE_LCD_SMALL - lv_obj_remove_style(obj, (lv_style_t*)&styles->pad_tiny_gap, selector); -#endif lv_obj_remove_style(obj, (lv_style_t*)&styles->pad_small, selector); lv_obj_remove_style(obj, (lv_style_t*)&styles->pad_medium, selector); lv_obj_remove_style(obj, (lv_style_t*)&styles->pad_large, selector); lv_obj_remove_style(obj, (lv_style_t*)&styles->pad_zero, selector); lv_obj_remove_style(obj, (lv_style_t*)&styles->pad_button, selector); switch (padding) { -#if LANDSCAPE_LCD_SMALL - case PAD_TINY_GAP: - etx_obj_add_style(obj, styles->pad_tiny_gap, selector); - break; -#endif case PAD_TINY: etx_obj_add_style(obj, styles->pad_tiny, selector); break; diff --git a/radio/src/gui/colorlcd/libui/etx_lv_theme.h b/radio/src/gui/colorlcd/libui/etx_lv_theme.h index ffe63aa707f..83a8a193a67 100644 --- a/radio/src/gui/colorlcd/libui/etx_lv_theme.h +++ b/radio/src/gui/colorlcd/libui/etx_lv_theme.h @@ -37,7 +37,6 @@ enum PaddingSize { PAD_ZERO = 0, PAD_TINY = 1, - PAD_TINY_GAP = 2, PAD_SMALL = 3, PAD_MEDIUM = 4, PAD_LARGE = 6 @@ -46,7 +45,6 @@ enum PaddingSize { enum PaddingSize { PAD_ZERO = 0, PAD_TINY = 2, - PAD_TINY_GAP = 2, PAD_SMALL = 4, PAD_MEDIUM = 6, PAD_LARGE = 8 @@ -187,9 +185,6 @@ class EdgeTxStyles // Static styles static const lv_style_t pad_zero; static const lv_style_t pad_tiny; -#if LANDSCAPE_LCD_SMALL - static const lv_style_t pad_tiny_gap; -#endif static const lv_style_t pad_small; static const lv_style_t pad_medium; static const lv_style_t pad_large; diff --git a/radio/src/gui/colorlcd/libui/window.cpp b/radio/src/gui/colorlcd/libui/window.cpp index 93cb83a7300..6520d8d063d 100644 --- a/radio/src/gui/colorlcd/libui/window.cpp +++ b/radio/src/gui/colorlcd/libui/window.cpp @@ -511,9 +511,9 @@ SetupLine::SetupLine(Window* parent, coord_t y, coord_t col2, PaddingSize paddin padAll(PAD_ZERO); coord_t titleY = PAD_LARGE + lblYOffset; coord_t titleH = EdgeTxStyles::PAGE_LINE_HEIGHT; - coord_t h = EdgeTxStyles::UI_ELEMENT_HEIGHT + PAD_TINY_GAP * 2 + lblYOffset * 2; + coord_t h = EdgeTxStyles::UI_ELEMENT_HEIGHT + PAD_TINY * 2 + lblYOffset * 2; if (createEdit) { - coord_t editY = PAD_TINY_GAP; + coord_t editY = PAD_TINY; coord_t lblWidth = col2 - PAD_SMALL - PAD_TINY; if (title) { if (getTextWidth(title) >= lblWidth) { diff --git a/radio/src/gui/colorlcd/model/function_switches.cpp b/radio/src/gui/colorlcd/model/function_switches.cpp index a174f2b255b..d45c9765d55 100644 --- a/radio/src/gui/colorlcd/model/function_switches.cpp +++ b/radio/src/gui/colorlcd/model/function_switches.cpp @@ -57,9 +57,9 @@ class FunctionSwitch : public Window { public: FunctionSwitch(Window* parent, uint8_t sw) : - Window(parent, {0, 0, LCD_W - PAD_SMALL * 2, EdgeTxStyles::UI_ELEMENT_HEIGHT + PAD_TINY_GAP * 2}), switchIndex(sw) + Window(parent, {0, 0, LCD_W - PAD_SMALL * 2, EdgeTxStyles::UI_ELEMENT_HEIGHT + PAD_TINY * 2}), switchIndex(sw) { - padAll(PAD_TINY_GAP); + padAll(PAD_TINY); std::string s(STR_CHAR_SWITCH); s += switchGetName(switchIndex + switchGetMaxSwitches()); @@ -246,9 +246,9 @@ class SwitchGroup : public Window { public: SwitchGroup(Window* parent, uint8_t group) : - Window(parent, {0, 0, LCD_W - PAD_SMALL * 2, EdgeTxStyles::UI_ELEMENT_HEIGHT + PAD_TINY_GAP * 2}), groupIndex(group) + Window(parent, {0, 0, LCD_W - PAD_SMALL * 2, EdgeTxStyles::UI_ELEMENT_HEIGHT + PAD_TINY * 2}), groupIndex(group) { - padAll(PAD_TINY_GAP); + padAll(PAD_TINY); new StaticText(this, {0, PAD_MEDIUM, NM_W, EdgeTxStyles::PAGE_LINE_HEIGHT}, STR_FUNCTION_SWITCH_GROUPS[groupIndex]); diff --git a/radio/src/gui/colorlcd/model/special_functions.h b/radio/src/gui/colorlcd/model/special_functions.h index 954a09db107..bc390214ab9 100644 --- a/radio/src/gui/colorlcd/model/special_functions.h +++ b/radio/src/gui/colorlcd/model/special_functions.h @@ -67,7 +67,7 @@ class FunctionLineButton : public ListLineButton static constexpr coord_t RP_Y = NM_Y; static constexpr coord_t RP_H = NM_H; static constexpr coord_t EN_X = RP_X + RP_W + PAD_TINY; - static constexpr coord_t EN_Y = NM_Y + PAD_TINY_GAP; + static constexpr coord_t EN_Y = NM_Y + PAD_TINY; static LAYOUT_VAL(EN_SZ, 16, 16, LS(16)) protected: diff --git a/radio/src/gui/colorlcd/radio/radio_setup.cpp b/radio/src/gui/colorlcd/radio/radio_setup.cpp index e245c812ee5..d8f2e21bb31 100644 --- a/radio/src/gui/colorlcd/radio/radio_setup.cpp +++ b/radio/src/gui/colorlcd/radio/radio_setup.cpp @@ -77,7 +77,7 @@ class DateTimeWindow : public Window // Absolute layout for date/time setion due to slow performance // of lv_textarea in a flex layout. static LAYOUT_VAL(DT_EDT_W, 80, 52, LS(80)) - static LAYOUT_VAL(DT_Y1, PAD_TINY_GAP, PAD_TINY_GAP, PAD_TINY_GAP) + static LAYOUT_VAL(DT_Y1, PAD_TINY, PAD_TINY, PAD_TINY) static LAYOUT_VAL(DT_Y2, DT_Y1 + EdgeTxStyles::UI_ELEMENT_HEIGHT + PAD_MEDIUM, DT_Y1 + EdgeTxStyles::UI_ELEMENT_HEIGHT + PAD_MEDIUM, DT_Y1 + EdgeTxStyles::UI_ELEMENT_HEIGHT + PAD_MEDIUM) protected: @@ -123,7 +123,7 @@ class DateTimeWindow : public Window m_last_tm = m_tm; // Date - new StaticText(this, rect_t{PAD_TINY_GAP, DT_Y1 + PAD_MEDIUM, SubPage::EDT_X - PAD_TINY_GAP - PAD_SMALL, EdgeTxStyles::PAGE_LINE_HEIGHT}, STR_DATE); + new StaticText(this, rect_t{PAD_TINY, DT_Y1 + PAD_MEDIUM, SubPage::EDT_X - PAD_TINY - PAD_SMALL, EdgeTxStyles::PAGE_LINE_HEIGHT}, STR_DATE); year = new NumberEdit( this, rect_t{SubPage::EDT_X, DT_Y1, DT_EDT_W, 0}, 2023, 2037, [=]() -> int32_t { return TM_YEAR_BASE + m_tm.tm_year; }, @@ -134,7 +134,7 @@ class DateTimeWindow : public Window }); month = new NumberEdit( - this, rect_t{SubPage::EDT_X + DT_EDT_W + PAD_TINY_GAP, DT_Y1, DT_EDT_W, 0}, 1, 12, + this, rect_t{SubPage::EDT_X + DT_EDT_W + PAD_TINY, DT_Y1, DT_EDT_W, 0}, 1, 12, [=]() -> int32_t { return 1 + m_tm.tm_mon; }, [=](int32_t newValue) { m_last_tm.tm_mon = m_tm.tm_mon = newValue - 1; @@ -155,7 +155,7 @@ class DateTimeWindow : public Window [](int32_t value) { return formatNumberAsString(value, LEADING0, 2); }); // Time - new StaticText(this, rect_t{PAD_TINY_GAP, DT_Y2 + PAD_MEDIUM, SubPage::EDT_X - PAD_TINY_GAP - PAD_SMALL, EdgeTxStyles::PAGE_LINE_HEIGHT}, STR_TIME); + new StaticText(this, rect_t{PAD_TINY, DT_Y2 + PAD_MEDIUM, SubPage::EDT_X - PAD_TINY - PAD_SMALL, EdgeTxStyles::PAGE_LINE_HEIGHT}, STR_TIME); hour = new NumberEdit( this, rect_t{SubPage::EDT_X, DT_Y2, DT_EDT_W, 0}, 0, 23, [=]() -> int32_t { return m_tm.tm_hour; }, @@ -167,7 +167,7 @@ class DateTimeWindow : public Window [](int32_t value) { return formatNumberAsString(value, LEADING0, 2); }); minutes = new NumberEdit( - this, rect_t{SubPage::EDT_X + DT_EDT_W + PAD_TINY_GAP, DT_Y2, DT_EDT_W, 0}, 0, 59, + this, rect_t{SubPage::EDT_X + DT_EDT_W + PAD_TINY, DT_Y2, DT_EDT_W, 0}, 0, 59, [=]() -> int32_t { return m_tm.tm_min; }, [=](int32_t newValue) { m_last_tm.tm_min = m_tm.tm_min = newValue;