chore(indev) minor formatting
This commit is contained in:
@@ -143,29 +143,32 @@ void lv_indev_reset(lv_indev_t * indev, lv_obj_t * obj)
|
|||||||
if(indev) {
|
if(indev) {
|
||||||
indev->proc.reset_query = 1;
|
indev->proc.reset_query = 1;
|
||||||
if(indev_act == indev) indev_obj_act = NULL;
|
if(indev_act == indev) indev_obj_act = NULL;
|
||||||
if(obj == NULL || indev->proc.types.pointer.last_pressed == obj) {
|
if(indev->driver->type == LV_INDEV_TYPE_POINTER || indev->driver->type == LV_INDEV_TYPE_KEYPAD) {
|
||||||
indev->proc.types.pointer.last_pressed = NULL;
|
if(obj == NULL || indev->proc.types.pointer.last_pressed == obj) {
|
||||||
}
|
indev->proc.types.pointer.last_pressed = NULL;
|
||||||
if(obj == NULL || indev->proc.types.pointer.act_obj == obj) {
|
}
|
||||||
indev->proc.types.pointer.act_obj = NULL;
|
if(obj == NULL || indev->proc.types.pointer.act_obj == obj) {
|
||||||
}
|
indev->proc.types.pointer.act_obj = NULL;
|
||||||
if(obj == NULL || indev->proc.types.pointer.last_obj == obj) {
|
}
|
||||||
indev->proc.types.pointer.last_obj = NULL;
|
if(obj == NULL || indev->proc.types.pointer.last_obj == obj) {
|
||||||
|
indev->proc.types.pointer.last_obj = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lv_indev_t * i = lv_indev_get_next(NULL);
|
lv_indev_t * i = lv_indev_get_next(NULL);
|
||||||
while(i) {
|
while(i) {
|
||||||
i->proc.reset_query = 1;
|
i->proc.reset_query = 1;
|
||||||
if((i->driver->type == LV_INDEV_TYPE_POINTER || i->driver->type == LV_INDEV_TYPE_KEYPAD) &&
|
if(i->driver->type == LV_INDEV_TYPE_POINTER || i->driver->type == LV_INDEV_TYPE_KEYPAD) {
|
||||||
(obj == NULL || i->proc.types.pointer.last_pressed == obj)) {
|
if(obj == NULL || i->proc.types.pointer.last_pressed == obj) {
|
||||||
i->proc.types.pointer.last_pressed = NULL;
|
i->proc.types.pointer.last_pressed = NULL;
|
||||||
}
|
}
|
||||||
if(obj == NULL || i->proc.types.pointer.act_obj == obj) {
|
if(obj == NULL || i->proc.types.pointer.act_obj == obj) {
|
||||||
i->proc.types.pointer.act_obj = NULL;
|
i->proc.types.pointer.act_obj = NULL;
|
||||||
}
|
}
|
||||||
if(obj == NULL || i->proc.types.pointer.last_obj == obj) {
|
if(obj == NULL || i->proc.types.pointer.last_obj == obj) {
|
||||||
i->proc.types.pointer.last_obj = NULL;
|
i->proc.types.pointer.last_obj = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
i = lv_indev_get_next(i);
|
i = lv_indev_get_next(i);
|
||||||
}
|
}
|
||||||
@@ -990,66 +993,67 @@ static void indev_proc_reset_query_handler(lv_indev_t * indev)
|
|||||||
static void indev_click_focus(_lv_indev_proc_t * proc)
|
static void indev_click_focus(_lv_indev_proc_t * proc)
|
||||||
{
|
{
|
||||||
/*Handle click focus*/
|
/*Handle click focus*/
|
||||||
lv_obj_t * obj_to_focus = indev_obj_act;
|
if(lv_obj_has_flag(indev_obj_act, LV_OBJ_FLAG_CLICK_FOCUSABLE) == false ||
|
||||||
if(lv_obj_has_flag(obj_to_focus, LV_OBJ_FLAG_CLICK_FOCUSABLE) &&
|
proc->types.pointer.last_pressed == indev_obj_act)
|
||||||
proc->types.pointer.last_pressed != obj_to_focus) {
|
{
|
||||||
lv_group_t * g_act = lv_obj_get_group(obj_to_focus);
|
return;
|
||||||
lv_group_t * g_prev = proc->types.pointer.last_pressed ? lv_obj_get_group(proc->types.pointer.last_pressed) : NULL;
|
}
|
||||||
|
|
||||||
/*If both the last and act. obj. are in the same group (or no group but it's also the same)*/
|
lv_group_t * g_act = lv_obj_get_group(indev_obj_act);
|
||||||
if(g_act == g_prev) {
|
lv_group_t * g_prev = proc->types.pointer.last_pressed ? lv_obj_get_group(proc->types.pointer.last_pressed) : NULL;
|
||||||
/*The objects are in a group*/
|
|
||||||
if(g_act) {
|
|
||||||
lv_group_focus_obj(obj_to_focus);
|
|
||||||
if(indev_reset_check(proc)) return;
|
|
||||||
}
|
|
||||||
/*The object are not in group*/
|
|
||||||
else {
|
|
||||||
if(proc->types.pointer.last_pressed) {
|
|
||||||
lv_event_send(proc->types.pointer.last_pressed, LV_EVENT_DEFOCUSED, indev_act);
|
|
||||||
if(indev_reset_check(proc)) return;
|
|
||||||
}
|
|
||||||
|
|
||||||
lv_event_send(obj_to_focus, LV_EVENT_FOCUSED, indev_act);
|
/*If both the last and act. obj. are in the same group (or have no group)*/
|
||||||
if(indev_reset_check(proc)) return;
|
if(g_act == g_prev) {
|
||||||
}
|
/*The objects are in a group*/
|
||||||
|
if(g_act) {
|
||||||
|
lv_group_focus_obj(indev_obj_act);
|
||||||
|
if(indev_reset_check(proc)) return;
|
||||||
}
|
}
|
||||||
/*The object are not in the same group (in different group or one in not a group)*/
|
/*The object are not in group*/
|
||||||
else {
|
else {
|
||||||
/*If the prev. obj. is not in a group then defocus it.*/
|
if(proc->types.pointer.last_pressed) {
|
||||||
if(g_prev == NULL && proc->types.pointer.last_pressed) {
|
|
||||||
lv_event_send(proc->types.pointer.last_pressed, LV_EVENT_DEFOCUSED, indev_act);
|
lv_event_send(proc->types.pointer.last_pressed, LV_EVENT_DEFOCUSED, indev_act);
|
||||||
if(indev_reset_check(proc)) return;
|
if(indev_reset_check(proc)) return;
|
||||||
}
|
}
|
||||||
/*Focus on a non-group object*/
|
|
||||||
else {
|
lv_event_send(indev_obj_act, LV_EVENT_FOCUSED, indev_act);
|
||||||
if(proc->types.pointer.last_pressed) {
|
if(indev_reset_check(proc)) return;
|
||||||
/*If the prev. object also wasn't in a group defocus it*/
|
}
|
||||||
if(g_prev == NULL) {
|
}
|
||||||
lv_event_send(proc->types.pointer.last_pressed, LV_EVENT_DEFOCUSED, indev_act);
|
/*The object are not in the same group (in different groups or one has no group)*/
|
||||||
if(indev_reset_check(proc)) return;
|
else {
|
||||||
}
|
/*If the prev. obj. is not in a group then defocus it.*/
|
||||||
/*If the prev. object also was in a group at least "LEAVE" it instead of defocus*/
|
if(g_prev == NULL && proc->types.pointer.last_pressed) {
|
||||||
else {
|
lv_event_send(proc->types.pointer.last_pressed, LV_EVENT_DEFOCUSED, indev_act);
|
||||||
lv_event_send(proc->types.pointer.last_pressed, LV_EVENT_LEAVE, indev_act);
|
if(indev_reset_check(proc)) return;
|
||||||
if(indev_reset_check(proc)) return;
|
}
|
||||||
}
|
/*Focus on a non-group object*/
|
||||||
|
else {
|
||||||
|
if(proc->types.pointer.last_pressed) {
|
||||||
|
/*If the prev. object also wasn't in a group defocus it*/
|
||||||
|
if(g_prev == NULL) {
|
||||||
|
lv_event_send(proc->types.pointer.last_pressed, LV_EVENT_DEFOCUSED, indev_act);
|
||||||
|
if(indev_reset_check(proc)) return;
|
||||||
|
}
|
||||||
|
/*If the prev. object also was in a group at least "LEAVE" it instead of defocus*/
|
||||||
|
else {
|
||||||
|
lv_event_send(proc->types.pointer.last_pressed, LV_EVENT_LEAVE, indev_act);
|
||||||
|
if(indev_reset_check(proc)) return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Focus to the act. in its group*/
|
|
||||||
if(g_act) {
|
|
||||||
lv_group_focus_obj(obj_to_focus);
|
|
||||||
if(indev_reset_check(proc)) return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
lv_event_send(obj_to_focus, LV_EVENT_FOCUSED, indev_act);
|
|
||||||
if(indev_reset_check(proc)) return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
proc->types.pointer.last_pressed = obj_to_focus;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/*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_event_send(indev_obj_act, LV_EVENT_FOCUSED, indev_act);
|
||||||
|
if(indev_reset_check(proc)) return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
proc->types.pointer.last_pressed = indev_obj_act;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user