Skip to content

Commit

Permalink
Fix enabled and add click attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
fvanroie committed Apr 27, 2021
1 parent 1bd4e69 commit 75debb2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/hasp/hasp_attribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/hasp/hasp_attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 75debb2

Please sign in to comment.