diff --git a/src/hasp/hasp_attribute.cpp b/src/hasp/hasp_attribute.cpp index f72b7831..674a743a 100644 --- a/src/hasp/hasp_attribute.cpp +++ b/src/hasp/hasp_attribute.cpp @@ -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); diff --git a/src/hasp/hasp_attribute.h b/src/hasp/hasp_attribute.h index ca260c85..f08b1a2b 100644 --- a/src/hasp/hasp_attribute.h +++ b/src/hasp/hasp_attribute.h @@ -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