feat(indev) allow input events to be passed to disabled objects (#2033)

This commit is contained in:
scandermore 2021-01-26 18:16:47 +01:00 committed by GitHub
parent eaacde6722
commit dacca6eeb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -2,6 +2,10 @@
## v7.9.1 (Planned at 19.01.2020)
### New features
- feat(indev) allow input events to be passed to disabled objects
### Bugfixes
- fix(cpicker) fix division by zero
- fix(dropdown) fix selecting options after the last one

View File

@ -1148,7 +1148,12 @@ lv_obj_t * lv_indev_search_obj(lv_obj_t * obj, lv_point_t * point)
hidden_i = lv_obj_get_parent(hidden_i);
}
/*No parent found with hidden == true*/
if(hidden_i == NULL && (lv_obj_get_state(obj, LV_OBJ_PART_MAIN) & LV_STATE_DISABLED) == false) found_p = obj;
if(lv_obj_is_protected(indev_obj_act, LV_PROTECT_EVENT_TO_DISABLED) == false){
if(hidden_i == NULL && (lv_obj_get_state(obj, LV_OBJ_PART_MAIN) & LV_STATE_DISABLED) == false) found_p = obj;
}
else {
if(hidden_i == NULL) found_p = obj;
}
}
}

View File

@ -177,6 +177,7 @@ enum {
LV_PROTECT_PRESS_LOST = 0x10, /**< If the `indev` was pressing this object but swiped out while
pressing do not search other object.*/
LV_PROTECT_CLICK_FOCUS = 0x20, /**< Prevent focusing the object by clicking on it*/
LV_PROTECT_EVENT_TO_DISABLED = 0x40, /**< Pass events even to disabled objects*/
};
typedef uint8_t lv_protect_t;