mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-11-13 23:27:14 +00:00
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:
parent
16858937e6
commit
5bd685aa86
2 changed files with 5 additions and 2 deletions
|
@ -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 image_parse_sub_domain(struct image* image, FILE* rsp, struct token property, char* message) {
|
||||||
bool needs_refresh = false;
|
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,
|
return image_set_enabled(image,
|
||||||
evaluate_boolean_state(get_token(&message),
|
evaluate_boolean_state(get_token(&message),
|
||||||
image->enabled) );
|
image->enabled) );
|
||||||
|
}
|
||||||
else if (token_equals(property, PROPERTY_SCALE)) {
|
else if (token_equals(property, PROPERTY_SCALE)) {
|
||||||
ANIMATE_FLOAT(image_set_scale,
|
ANIMATE_FLOAT(image_set_scale,
|
||||||
image,
|
image,
|
||||||
|
|
|
@ -303,7 +303,6 @@ bool text_animate_scroll(struct text* text) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void text_draw(struct text* text, CGContextRef context) {
|
void text_draw(struct text* text, CGContextRef context) {
|
||||||
|
|
||||||
if (!text->drawing) return;
|
if (!text->drawing) return;
|
||||||
if (text->background.enabled)
|
if (text->background.enabled)
|
||||||
background_draw(&text->background, context);
|
background_draw(&text->background, context);
|
||||||
|
|
Loading…
Reference in a new issue