mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
fix(checkbox) remove unnecessary events (#2829)
* Fixed LV_EVENT_VALUE_CHANGED event in lv_checkbox * Update CHANGELOG.md * Removed LV_EVENT_PRESSED/RELEASED related event * Update docs/CHANGELOG.md Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
parent
ac7f31c716
commit
6791522588
@ -156,10 +156,7 @@ static void lv_checkbox_event(const lv_obj_class_t * class_p, lv_event_t * e)
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
lv_obj_t * obj = lv_event_get_target(e);
|
||||
|
||||
if(code == LV_EVENT_PRESSED || code == LV_EVENT_RELEASED) {
|
||||
lv_obj_invalidate(obj);
|
||||
}
|
||||
else if(code == LV_EVENT_GET_SELF_SIZE) {
|
||||
if(code == LV_EVENT_GET_SELF_SIZE) {
|
||||
lv_point_t * p = lv_event_get_param(e);
|
||||
lv_checkbox_t * cb = (lv_checkbox_t *)obj;
|
||||
|
||||
@ -188,13 +185,6 @@ static void lv_checkbox_event(const lv_obj_class_t * class_p, lv_event_t * e)
|
||||
lv_coord_t m = lv_obj_calculate_ext_draw_size(obj, LV_PART_INDICATOR);
|
||||
*s = LV_MAX(*s, m);
|
||||
}
|
||||
else if(code == LV_EVENT_RELEASED) {
|
||||
uint32_t v = lv_obj_get_state(obj) & LV_STATE_CHECKED ? 1 : 0;
|
||||
res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, &v);
|
||||
if(res != LV_RES_OK) return;
|
||||
|
||||
lv_obj_invalidate(obj);
|
||||
}
|
||||
else if(code == LV_EVENT_DRAW_MAIN) {
|
||||
lv_checkbox_draw(e);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user