lv_group: add click_focus option

This commit is contained in:
Gabor Kiss-Vamosi
2018-07-12 23:38:27 +02:00
parent 9a28e559a4
commit d483d14c8e
8 changed files with 157 additions and 24 deletions

View File

@@ -569,7 +569,17 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
ext->btn_id_tgl = ext->btn_id_pr;
}
#if USE_LV_GROUP
/*Leave the clicked button as pressed if this the focused object in a group*/
lv_group_t * g = lv_obj_get_group(btnm);
if(lv_group_get_focused(g) != btnm) {
ext->btn_id_pr = LV_BTNM_PR_NONE;
}
#else
ext->btn_id_pr = LV_BTNM_PR_NONE;
#endif
}
} else if(sign == LV_SIGNAL_PRESS_LOST || sign == LV_SIGNAL_DEFOCUS) {
ext->btn_id_pr = LV_BTNM_PR_NONE;