mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-04-19 12:57:19 +00:00
Fix enabled and add click attribute
This commit is contained in:
parent
1bd4e691ac
commit
75debb2502
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user