mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
minor fixes
This commit is contained in:
parent
e1457c968c
commit
8004058463
@ -102,6 +102,7 @@ void lv_example_spinner_1(void);
|
|||||||
void lv_example_switch_1(void);
|
void lv_example_switch_1(void);
|
||||||
|
|
||||||
void lv_example_table_1(void);
|
void lv_example_table_1(void);
|
||||||
|
void lv_example_table_2(void);
|
||||||
|
|
||||||
void lv_example_tabview_1(void);
|
void lv_example_tabview_1(void);
|
||||||
|
|
||||||
|
@ -560,7 +560,6 @@ static lv_coord_t elastic_diff(lv_obj_t * obj, lv_coord_t diff, lv_coord_t scrol
|
|||||||
/* If there is snapping in the current direction don't use the elastic factor because
|
/* If there is snapping in the current direction don't use the elastic factor because
|
||||||
* it's natural that the first and last items are scrolled (snapped) in. */
|
* it's natural that the first and last items are scrolled (snapped) in. */
|
||||||
lv_scroll_snap_t snap;
|
lv_scroll_snap_t snap;
|
||||||
void(*size)(const lv_area_t) = dir == LV_DIR_HOR ? lv_area_get_width : lv_area_get_height;
|
|
||||||
snap = dir == LV_DIR_HOR ? lv_obj_get_scroll_snap_x(obj) : lv_obj_get_scroll_snap_y(obj);
|
snap = dir == LV_DIR_HOR ? lv_obj_get_scroll_snap_x(obj) : lv_obj_get_scroll_snap_y(obj);
|
||||||
|
|
||||||
lv_obj_t * act_obj = lv_indev_get_obj_act();
|
lv_obj_t * act_obj = lv_indev_get_obj_act();
|
||||||
|
@ -129,6 +129,10 @@ void lv_mem_init(void)
|
|||||||
/*The total mem size reduced by the first header and the close patterns */
|
/*The total mem size reduced by the first header and the close patterns */
|
||||||
full->header.s.d_size = LV_MEM_SIZE - sizeof(lv_mem_header_t);
|
full->header.s.d_size = LV_MEM_SIZE - sizeof(lv_mem_header_t);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if LV_MEM_ADD_JUNK
|
||||||
|
LV_LOG_WARN("LV_MEM_ADD_JUNK is enabled which makes LVGL much slower")
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -181,17 +181,17 @@ void lv_btnmatrix_set_ctrl_map(lv_obj_t * obj, const lv_btnmatrix_ctrl_t ctrl_ma
|
|||||||
lv_btnmatrix_set_map(obj, btnm->map_p);
|
lv_btnmatrix_set_map(obj, btnm->map_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_btnmatrix_set_active_btn(lv_obj_t * obj, uint16_t id)
|
void lv_btnmatrix_set_selected_btn(lv_obj_t * obj, uint16_t btn_id)
|
||||||
{
|
{
|
||||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||||
|
|
||||||
lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;
|
lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;
|
||||||
|
|
||||||
if(id >= btnm->btn_cnt && id != LV_BTNMATRIX_BTN_NONE) return;
|
if(btn_id >= btnm->btn_cnt && btn_id != LV_BTNMATRIX_BTN_NONE) return;
|
||||||
|
|
||||||
invalidate_button_area(obj, btnm->btn_id_sel);
|
invalidate_button_area(obj, btnm->btn_id_sel);
|
||||||
btnm->btn_id_sel = id;
|
btnm->btn_id_sel = btn_id;
|
||||||
invalidate_button_area(obj, id);
|
invalidate_button_area(obj, btn_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_btnmatrix_set_recolor(const lv_obj_t * obj, bool en)
|
void lv_btnmatrix_set_recolor(const lv_obj_t * obj, bool en)
|
||||||
|
@ -106,6 +106,13 @@ void lv_btnmatrix_set_map(lv_obj_t * obj, const char * map[]);
|
|||||||
*/
|
*/
|
||||||
void lv_btnmatrix_set_ctrl_map(lv_obj_t * obj, const lv_btnmatrix_ctrl_t ctrl_map[]);
|
void lv_btnmatrix_set_ctrl_map(lv_obj_t * obj, const lv_btnmatrix_ctrl_t ctrl_map[]);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the selected buttons
|
||||||
|
* @param obj pointer to button matrix object
|
||||||
|
* @param id 0 based index of the button to modify. (Not counting new lines)
|
||||||
|
*/
|
||||||
|
void lv_btnmatrix_set_selected_btn(lv_obj_t * obj, uint16_t id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable recoloring of button's texts. E.g. "a #ff0000 red# word"
|
* Enable recoloring of button's texts. E.g. "a #ff0000 red# word"
|
||||||
* @param obj pointer to button matrix object
|
* @param obj pointer to button matrix object
|
||||||
|
@ -120,7 +120,7 @@ void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint16_t row, uint16_t col, con
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t cell = row * table->col_cnt + col;
|
uint32_t cell = row * table->col_cnt + col;
|
||||||
lv_table_cell_ctrl_t ctrl;
|
lv_table_cell_ctrl_t ctrl = 0;
|
||||||
|
|
||||||
/*Save the control byte*/
|
/*Save the control byte*/
|
||||||
if(table->cell_data[cell]) ctrl= table->cell_data[cell][0];
|
if(table->cell_data[cell]) ctrl= table->cell_data[cell][0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user