fix(ui): Tweak mixer overview layout for long names (#2851)

* Fix Mixer layout on color lcd screen to accommodate long input names.
* Adjust layout for portrait orientation.
This commit is contained in:
philmoz
2022-12-14 19:33:16 +10:00
committed by GitHub
parent 650406db52
commit 2c47d5440c
2 changed files with 8 additions and 10 deletions
+7 -9
View File
@@ -34,9 +34,9 @@ STATIC_LZ4_BITMAP(mask_textline_fm);
#if LCD_W > LCD_H // Landscape
static const lv_coord_t col_dsc[] = {
LV_GRID_FR(1), // weigth
LV_GRID_FR(1), // source
LV_GRID_FR(4), // opts
LV_GRID_FR(7), // weight
LV_GRID_FR(12), // source
LV_GRID_FR(29), // opts
FM_CANVAS_WIDTH, // flight modes
LV_GRID_TEMPLATE_LAST
};
@@ -45,9 +45,9 @@ static const lv_coord_t row_dsc[] = {LV_GRID_CONTENT,
LV_GRID_TEMPLATE_LAST};
#else // Portrait
static const lv_coord_t col_dsc[] = {
LV_GRID_FR(1), // weigth
LV_GRID_FR(1), // source
LV_GRID_FR(2), // opts
LV_GRID_FR(13), // weight
LV_GRID_FR(21), // source
LV_GRID_FR(32), // opts
LV_GRID_TEMPLATE_LAST
};
@@ -56,8 +56,6 @@ static const lv_coord_t row_dsc[] = {LV_GRID_CONTENT,
LV_GRID_TEMPLATE_LAST};
#endif
static const char _empty_txt[] = "";
InputMixButton::InputMixButton(Window* parent, uint8_t index) :
ListLineButton(parent, index)
{
@@ -65,7 +63,7 @@ InputMixButton::InputMixButton(Window* parent, uint8_t index) :
lv_obj_set_grid_dsc_array(lvobj, col_dsc, row_dsc);
weight = lv_label_create(lvobj);
lv_obj_set_grid_cell(weight, LV_GRID_ALIGN_END, 0, 1, LV_GRID_ALIGN_START, 0, 1);
lv_obj_set_grid_cell(weight, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_START, 0, 1);
source = lv_label_create(lvobj);
lv_obj_set_grid_cell(source, LV_GRID_ALIGN_START, 1, 1, LV_GRID_ALIGN_START, 0, 1);
+1 -1
View File
@@ -29,7 +29,7 @@
#include <algorithm>
static const lv_coord_t col_dsc[] = {
lv_coord_t(LV_DPI_DEF * 0.65), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST,
lv_coord_t(LV_DPI_DEF * 0.55), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST,
};
static const lv_coord_t row_dsc[] = {