mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 12:16:42 +00:00
Add scale attributes
This commit is contained in:
parent
87557f8b05
commit
5967d137f6
@ -10,12 +10,7 @@
|
|||||||
#include "../lv_components.h"
|
#include "../lv_components.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hasp.h"
|
#include "hasplib.h"
|
||||||
#include "hasp_object.h"
|
|
||||||
#include "hasp_dispatch.h"
|
|
||||||
#include "hasp_attribute.h"
|
|
||||||
#include "hasp_utilities.h"
|
|
||||||
#include "hasp_parser.h"
|
|
||||||
|
|
||||||
LV_FONT_DECLARE(unscii_8_icon);
|
LV_FONT_DECLARE(unscii_8_icon);
|
||||||
extern lv_font_t* haspFonts[8];
|
extern lv_font_t* haspFonts[8];
|
||||||
@ -826,6 +821,37 @@ static void hasp_local_style_attr(lv_obj_t* obj, const char* attr_p, uint16_t at
|
|||||||
return attribute_pad_inner(obj, part, state, update, attr_p, (lv_style_int_t)var);
|
return attribute_pad_inner(obj, part, state, update, attr_p, (lv_style_int_t)var);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Scale attributes */
|
||||||
|
case ATTR_SCALE_GRAD_COLOR: {
|
||||||
|
if(update) {
|
||||||
|
lv_color32_t c;
|
||||||
|
if(Parser::haspPayloadToColor(payload, c) && part != 64)
|
||||||
|
lv_obj_set_style_local_scale_grad_color(obj, part, state,
|
||||||
|
lv_color_make(c.ch.red, c.ch.green, c.ch.blue));
|
||||||
|
} else {
|
||||||
|
hasp_out_color(obj, attr, lv_obj_get_style_scale_grad_color(obj, part));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
case ATTR_SCALE_END_COLOR:
|
||||||
|
if(update) {
|
||||||
|
lv_color32_t c;
|
||||||
|
if(Parser::haspPayloadToColor(payload, c))
|
||||||
|
lv_obj_set_style_local_scale_end_color(obj, part, state,
|
||||||
|
lv_color_make(c.ch.red, c.ch.green, c.ch.blue));
|
||||||
|
} else {
|
||||||
|
hasp_out_color(obj, attr, lv_obj_get_style_scale_end_color(obj, part));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
case ATTR_SCALE_END_LINE_WIDTH:
|
||||||
|
return attribute_scale_end_line_width(obj, part, state, update, attr_p, (lv_style_int_t)var);
|
||||||
|
case ATTR_SCALE_END_BORDER_WIDTH:
|
||||||
|
return attribute_scale_end_border_width(obj, part, state, update, attr_p, (lv_style_int_t)var);
|
||||||
|
case ATTR_SCALE_BORDER_WIDTH:
|
||||||
|
return attribute_scale_border_width(obj, part, state, update, attr_p, (lv_style_int_t)var);
|
||||||
|
case ATTR_SCALE_WIDTH:
|
||||||
|
return attribute_scale_width(obj, part, state, update, attr_p, (lv_style_int_t)var);
|
||||||
|
|
||||||
/* Text attributes */
|
/* Text attributes */
|
||||||
case ATTR_TEXT_LETTER_SPACE:
|
case ATTR_TEXT_LETTER_SPACE:
|
||||||
return attribute_text_letter_space(obj, part, state, update, attr_p, (lv_style_int_t)var);
|
return attribute_text_letter_space(obj, part, state, update, attr_p, (lv_style_int_t)var);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user