allow setting the image string as image.string=<string> instead of only via image=<string> (similar to icon=<string> and icon.string=<string>)

This commit is contained in:
Felix Kratz 2024-02-21 17:32:31 +01:00
parent 16858937e6
commit 5bd685aa86
2 changed files with 5 additions and 2 deletions

View file

@ -339,10 +339,14 @@ void image_serialize(struct image* image, char* indent, FILE* rsp) {
bool image_parse_sub_domain(struct image* image, FILE* rsp, struct token property, char* message) {
bool needs_refresh = false;
if (token_equals(property, PROPERTY_DRAWING))
if (token_equals(property, PROPERTY_STRING)) {
return image_load(image, token_to_string(get_token(&message)), rsp);
}
else if (token_equals(property, PROPERTY_DRAWING)) {
return image_set_enabled(image,
evaluate_boolean_state(get_token(&message),
image->enabled) );
}
else if (token_equals(property, PROPERTY_SCALE)) {
ANIMATE_FLOAT(image_set_scale,
image,

View file

@ -303,7 +303,6 @@ bool text_animate_scroll(struct text* text) {
}
void text_draw(struct text* text, CGContextRef context) {
if (!text->drawing) return;
if (text->background.enabled)
background_draw(&text->background, context);