Fix enabled and add click attribute

This commit is contained in:
fvanroie 2021-04-27 03:29:17 +02:00
parent 1bd4e691ac
commit 75debb2502
2 changed files with 12 additions and 1 deletions

View File

@ -1541,10 +1541,20 @@ void hasp_process_obj_attribute(lv_obj_t* obj, const char* attr_p, const char* p
: attr_out_int(obj, attr, lv_obj_get_style_opa_scale(obj, LV_OBJ_PART_MAIN));
break; // attribute_found
case ATTR_ENABLED:
case ATTR_CLICK:
update ? lv_obj_set_click(obj, Parser::is_true(payload)) : attr_out_int(obj, attr, lv_obj_get_click(obj));
break; // attribute_found
case ATTR_ENABLED:
if(update)
if(Parser::is_true(payload))
lv_obj_clear_state(obj, LV_STATE_DISABLED);
else
lv_obj_add_state(obj, LV_STATE_DISABLED);
else
attr_out_int(obj, attr, !(lv_obj_get_state(obj, LV_BTN_PART_MAIN) & LV_STATE_DISABLED));
break; // attribute_found
case ATTR_SWIPE:
update ? (void)(obj->user_data.swipeid = Parser::is_true(payload) % 16)
: attr_out_int(obj, attr, obj->user_data.swipeid);

View File

@ -273,6 +273,7 @@ _HASP_ATTRIBUTE(SCALE_END_LINE_WIDTH, scale_end_line_width, lv_style_int_t)
#define ATTR_H 104
#define ATTR_OPTIONS 29886
#define ATTR_ENABLED 28193
#define ATTR_CLICK 17064
#define ATTR_OPACITY 10155
#define ATTR_TOGGLE 38580
#define ATTR_HIDDEN 11082