From 5964b0b9015ded2581fe2a898d5713155ba180e2 Mon Sep 17 00:00:00 2001 From: philmoz Date: Thu, 23 Mar 2023 21:36:30 +1100 Subject: [PATCH] fix(color): Improve responsiveness of the model outputs tab while loading (#3361) * Improve responsiveness of the outputs tab. * Fix line height on portrait layout. --- radio/src/gui/colorlcd/model_outputs.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/radio/src/gui/colorlcd/model_outputs.cpp b/radio/src/gui/colorlcd/model_outputs.cpp index 70c9e0902..507ba5906 100644 --- a/radio/src/gui/colorlcd/model_outputs.cpp +++ b/radio/src/gui/colorlcd/model_outputs.cpp @@ -38,6 +38,8 @@ STATIC_LZ4_BITMAP(mask_textline_curve); #if LCD_W > LCD_H // Landscape +#define CH_LINE_H 35 + #define CH_BAR_COL 7 #define CH_BAR_COLSPAN 1 @@ -50,6 +52,8 @@ static const lv_coord_t row_dsc[] = {LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST}; #else // Portrait +#define CH_LINE_H 50 + #define CH_BAR_COL 3 #define CH_BAR_COLSPAN 3 @@ -156,6 +160,7 @@ class OutputLineButton : public ListLineButton OutputLineButton(Window* parent, uint8_t channel) : ListLineButton(parent, channel) { + setHeight(CH_LINE_H); lv_obj_set_layout(lvobj, LV_LAYOUT_GRID); lv_obj_set_grid_dsc_array(lvobj, col_dsc, row_dsc); @@ -171,9 +176,6 @@ class OutputLineButton : public ListLineButton LV_GRID_ALIGN_CENTER, 0, 1); #endif - lv_obj_update_layout(parent->getLvObj()); - if(lv_obj_is_visible(lvobj)) delayed_init(nullptr); - lv_obj_add_event_cb(lvobj, OutputLineButton::on_draw, LV_EVENT_DRAW_MAIN_BEGIN, nullptr); } @@ -322,10 +324,6 @@ void ModelOutputsPage::build(FormWindow *window) // Channel settings auto btn = new OutputLineButton(window, ch); -#if LCD_W > LCD_H - // Initial scroll height is incorrect without this??? (Issue #3186) - btn->setHeight(35); -#endif LimitData* output = limitAddress(ch); btn->setPressHandler([=]() -> uint8_t {