fix focusing/defocusing for pages
This commit is contained in:
@@ -1183,11 +1183,6 @@ static void indev_click_focus(lv_indev_proc_t * proc)
|
|||||||
}
|
}
|
||||||
/*The object are not in the same group (in different group or one in not a group)*/
|
/*The object are not in the same group (in different group or one in not a group)*/
|
||||||
else {
|
else {
|
||||||
/*Focus to the act. its group*/
|
|
||||||
if(g_act) {
|
|
||||||
lv_group_focus_obj(indev_obj_act);
|
|
||||||
if(indev_reset_check(proc)) return;
|
|
||||||
}
|
|
||||||
/*If the prev. obj. is not in a group then defocus it.*/
|
/*If the prev. obj. is not in a group then defocus it.*/
|
||||||
if(g_prev == NULL && proc->types.pointer.last_pressed) {
|
if(g_prev == NULL && proc->types.pointer.last_pressed) {
|
||||||
lv_signal_send(proc->types.pointer.last_pressed, LV_SIGNAL_DEFOCUS, NULL);
|
lv_signal_send(proc->types.pointer.last_pressed, LV_SIGNAL_DEFOCUS, NULL);
|
||||||
@@ -1213,7 +1208,13 @@ static void indev_click_focus(lv_indev_proc_t * proc)
|
|||||||
if(indev_reset_check(proc)) return;
|
if(indev_reset_check(proc)) return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Focus to the act. in its group*/
|
||||||
|
if(g_act) {
|
||||||
|
lv_group_focus_obj(indev_obj_act);
|
||||||
|
if(indev_reset_check(proc)) return;
|
||||||
|
} else {
|
||||||
lv_signal_send(indev_obj_act, LV_SIGNAL_FOCUS, NULL);
|
lv_signal_send(indev_obj_act, LV_SIGNAL_FOCUS, NULL);
|
||||||
if(indev_reset_check(proc)) return;
|
if(indev_reset_check(proc)) return;
|
||||||
lv_event_send(indev_obj_act, LV_EVENT_FOCUSED, NULL);
|
lv_event_send(indev_obj_act, LV_EVENT_FOCUSED, NULL);
|
||||||
|
|||||||
@@ -3752,7 +3752,6 @@ static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param)
|
|||||||
else if(sign == LV_SIGNAL_RELEASED || sign == LV_SIGNAL_PRESS_LOST) {
|
else if(sign == LV_SIGNAL_RELEASED || sign == LV_SIGNAL_PRESS_LOST) {
|
||||||
lv_obj_clear_state(obj, LV_STATE_PRESSED);
|
lv_obj_clear_state(obj, LV_STATE_PRESSED);
|
||||||
}
|
}
|
||||||
#if LV_USE_GROUP
|
|
||||||
else if(sign == LV_SIGNAL_FOCUS) {
|
else if(sign == LV_SIGNAL_FOCUS) {
|
||||||
if(lv_group_get_editing(lv_obj_get_group(obj))) {
|
if(lv_group_get_editing(lv_obj_get_group(obj))) {
|
||||||
uint8_t state = LV_STATE_FOCUSED;
|
uint8_t state = LV_STATE_FOCUSED;
|
||||||
@@ -3779,7 +3778,6 @@ static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param)
|
|||||||
|
|
||||||
lv_obj_clear_state(obj, LV_STATE_FOCUSED | LV_STATE_EDITED);
|
lv_obj_clear_state(obj, LV_STATE_FOCUSED | LV_STATE_EDITED);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
else if(sign == LV_SIGNAL_CLEANUP) {
|
else if(sign == LV_SIGNAL_CLEANUP) {
|
||||||
lv_obj_clean_style_list(obj, LV_OBJ_PART_MAIN);
|
lv_obj_clean_style_list(obj, LV_OBJ_PART_MAIN);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1054,11 +1054,17 @@ static lv_res_t lv_page_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, voi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(sign == LV_SIGNAL_DEFOCUS) {
|
else if(sign == LV_SIGNAL_DEFOCUS) {
|
||||||
|
bool in_group = false;
|
||||||
|
#if LV_USE_GROUP
|
||||||
|
in_group = lv_obj_get_group(page) ? true : false;
|
||||||
|
#endif
|
||||||
|
if(in_group == false) {
|
||||||
res = lv_signal_send(page, LV_SIGNAL_DEFOCUS, NULL);
|
res = lv_signal_send(page, LV_SIGNAL_DEFOCUS, NULL);
|
||||||
if(res != LV_RES_OK) return res;
|
if(res != LV_RES_OK) return res;
|
||||||
res = lv_event_send(page, LV_EVENT_DEFOCUSED, NULL);
|
res = lv_event_send(page, LV_EVENT_DEFOCUSED, NULL);
|
||||||
if(res != LV_RES_OK) return res;
|
if(res != LV_RES_OK) return res;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if(sign == LV_SIGNAL_CLEANUP) {
|
else if(sign == LV_SIGNAL_CLEANUP) {
|
||||||
page_ext->scrl = NULL;
|
page_ext->scrl = NULL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user