lv_btnm: fix sending events for hidden buttons
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
- add assert if `_lv_mem_buf_get()` fails
|
- add assert if `_lv_mem_buf_get()` fails
|
||||||
- `lv_textarea`: fix character delete in password mode
|
- `lv_textarea`: fix character delete in password mode
|
||||||
- Update `LV_OPA_MIN` and `LV_OPA_MAX` to widen the opacity processed range
|
- Update `LV_OPA_MIN` and `LV_OPA_MAX` to widen the opacity processed range
|
||||||
|
- `lv_btnm` fix sending events for hidden buttons
|
||||||
|
|
||||||
## v7.0.1 (01.06.2020)
|
## v7.0.1 (01.06.2020)
|
||||||
|
|
||||||
|
|||||||
@@ -821,11 +821,11 @@ static lv_res_t lv_btnmatrix_signal(lv_obj_t * btnm, lv_signal_t sign, void * pa
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(ext->btn_id_act != LV_BTNMATRIX_BTN_NONE) {
|
if(ext->btn_id_pr != LV_BTNMATRIX_BTN_NONE) {
|
||||||
if(button_is_click_trig(ext->ctrl_bits[ext->btn_id_act]) == false &&
|
if(button_is_click_trig(ext->ctrl_bits[ext->btn_id_pr]) == false &&
|
||||||
button_is_inactive(ext->ctrl_bits[ext->btn_id_act]) == false &&
|
button_is_inactive(ext->ctrl_bits[ext->btn_id_pr]) == false &&
|
||||||
button_is_hidden(ext->ctrl_bits[ext->btn_id_act]) == false) {
|
button_is_hidden(ext->ctrl_bits[ext->btn_id_pr]) == false) {
|
||||||
uint32_t b = ext->btn_id_act;
|
uint32_t b = ext->btn_id_pr;
|
||||||
res = lv_event_send(btnm, LV_EVENT_VALUE_CHANGED, &b);
|
res = lv_event_send(btnm, LV_EVENT_VALUE_CHANGED, &b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -844,21 +844,22 @@ static lv_res_t lv_btnmatrix_signal(lv_obj_t * btnm, lv_signal_t sign, void * pa
|
|||||||
if(ext->btn_id_pr != LV_BTNMATRIX_BTN_NONE) {
|
if(ext->btn_id_pr != LV_BTNMATRIX_BTN_NONE) {
|
||||||
invalidate_button_area(btnm, ext->btn_id_pr);
|
invalidate_button_area(btnm, ext->btn_id_pr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ext->btn_id_pr = btn_pr;
|
||||||
|
ext->btn_id_act = btn_pr;
|
||||||
|
|
||||||
lv_indev_reset_long_press(param); /*Start the log press time again on the new button*/
|
lv_indev_reset_long_press(param); /*Start the log press time again on the new button*/
|
||||||
if(btn_pr != LV_BTNMATRIX_BTN_NONE &&
|
if(btn_pr != LV_BTNMATRIX_BTN_NONE &&
|
||||||
button_is_inactive(ext->ctrl_bits[btn_pr]) == false &&
|
button_is_inactive(ext->ctrl_bits[btn_pr]) == false &&
|
||||||
button_is_hidden(ext->ctrl_bits[btn_pr]) == false) {
|
button_is_hidden(ext->ctrl_bits[btn_pr]) == false) {
|
||||||
/* Send VALUE_CHANGED for the newly pressed button */
|
/* Send VALUE_CHANGED for the newly pressed button */
|
||||||
uint32_t b = ext->btn_id_act;
|
uint32_t b = btn_pr;
|
||||||
res = lv_event_send(btnm, LV_EVENT_VALUE_CHANGED, &b);
|
res = lv_event_send(btnm, LV_EVENT_VALUE_CHANGED, &b);
|
||||||
if(res == LV_RES_OK) {
|
if(res == LV_RES_OK) {
|
||||||
invalidate_button_area(btnm, btn_pr);
|
invalidate_button_area(btnm, btn_pr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ext->btn_id_pr = btn_pr;
|
|
||||||
ext->btn_id_act = btn_pr;
|
|
||||||
}
|
}
|
||||||
else if(sign == LV_SIGNAL_RELEASED) {
|
else if(sign == LV_SIGNAL_RELEASED) {
|
||||||
if(ext->btn_id_pr != LV_BTNMATRIX_BTN_NONE) {
|
if(ext->btn_id_pr != LV_BTNMATRIX_BTN_NONE) {
|
||||||
|
|||||||
Reference in New Issue
Block a user