Skip to content

Commit

Permalink
Add #if HASP_USE_QRCODE
Browse files Browse the repository at this point in the history
  • Loading branch information
fvanroie committed Apr 3, 2024
1 parent 9b57bf6 commit 9ba2558
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/hasp/hasp_attribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1757,8 +1757,10 @@ static hasp_attribute_type_t attribute_common_text(lv_obj_t* obj, uint16_t attr_
#if LV_USE_WIN != 0
{LV_HASP_WINDOW, ATTR_TEXT, lv_win_set_title, lv_win_get_title},
#endif
{LV_HASP_MSGBOX, ATTR_TEXT, my_msgbox_set_text, lv_msgbox_get_text},
{LV_HASP_QRCODE, ATTR_TEXT, my_qrcode_set_text, my_qrcode_get_text}
#if HASP_USE_QRCODE > 0
{LV_HASP_QRCODE, ATTR_TEXT, my_qrcode_set_text, my_qrcode_get_text},
#endif
{LV_HASP_MSGBOX, ATTR_TEXT, my_msgbox_set_text, lv_msgbox_get_text}
};

for(int i = 0; i < sizeof(list) / sizeof(list[0]); i++) {
Expand Down Expand Up @@ -2375,12 +2377,12 @@ static hasp_attribute_type_t attribute_common_int(lv_obj_t* obj, uint16_t attr_h
val = obj->user_data.groupid;
break; // attribute_found

// case ATTR_TRANSITION:
// if(update)
// obj->user_data.transitionid = (uint8_t)val;
// else
// val = obj->user_data.transitionid;
// break; // attribute_found
// case ATTR_TRANSITION:
// if(update)
// obj->user_data.transitionid = (uint8_t)val;
// else
// val = obj->user_data.transitionid;
// break; // attribute_found

case ATTR_OBJID:
if(update && val != obj->user_data.objid) return HASP_ATTR_TYPE_INT_READONLY;
Expand Down Expand Up @@ -2452,6 +2454,7 @@ static hasp_attribute_type_t attribute_common_int(lv_obj_t* obj, uint16_t attr_h
val = lv_obj_get_ext_click_pad_top(obj);
break; // attribute_found

#if HASP_USE_QRCODE > 0
case ATTR_SIZE:
if(obj_check_type(obj, LV_HASP_QRCODE)) {
if(update) {
Expand All @@ -2461,6 +2464,7 @@ static hasp_attribute_type_t attribute_common_int(lv_obj_t* obj, uint16_t attr_h
}
}
break;
#endif

default:
return HASP_ATTR_TYPE_NOT_FOUND; // attribute_not found
Expand Down Expand Up @@ -2511,12 +2515,12 @@ static hasp_attribute_type_t attribute_common_bool(lv_obj_t* obj, uint16_t attr_
val = !(lv_obj_get_state(obj, LV_BTN_PART_MAIN) & LV_STATE_DISABLED);
break; // attribute_found

// case ATTR_SWIPE:
// if(update)
// obj->user_data.swipeid = (!!val) % 16;
// else
// val = obj->user_data.swipeid;
// break; // attribute_found
// case ATTR_SWIPE:
// if(update)
// obj->user_data.swipeid = (!!val) % 16;
// else
// val = obj->user_data.swipeid;
// break; // attribute_found

case ATTR_TOGGLE:
switch(obj_get_type(obj)) {
Expand Down

0 comments on commit 9ba2558

Please sign in to comment.