feat(color): Single select option for model labels. label AND/OR filtering logic (#4532)

This commit is contained in:
philmoz
2024-01-26 21:15:32 +10:00
committed by GitHub
parent 63bb205e6b
commit 2c01bee40d
32 changed files with 343 additions and 56 deletions
+5 -6
View File
@@ -169,20 +169,19 @@ coord_t TableField::getColumnWidth(uint16_t col) const
return lv_table_get_col_width(lvobj, col);
}
void TableField::select(uint16_t row, uint16_t col)
void TableField::select(uint16_t row, uint16_t col, bool force)
{
lv_table_t* table = (lv_table_t*)lvobj;
if (table->row_act == row && table->col_act == row) return;
if (!force && table->row_act == row && table->col_act == row) return;
if (row >= table->row_cnt || col >= table->col_cnt) {
table->col_act = LV_TABLE_CELL_NONE;
table->row_act = LV_TABLE_CELL_NONE;
return;
} else {
table->row_act = row;
table->col_act = col;
}
table->row_act = row;
table->col_act = col;
lv_obj_invalidate(lvobj);
adjustScroll();
}
+1 -1
View File
@@ -39,7 +39,7 @@ class TableField : public Window
void setColumnWidth(uint16_t col, coord_t w);
coord_t getColumnWidth(uint16_t col) const;
void select(uint16_t row, uint16_t col);
void select(uint16_t row, uint16_t col, bool force = false);
virtual void onPress(uint16_t row, uint16_t col) {}
protected: