From 1b9f9c34865c31f9ded4b61f57d7f9c047c188c8 Mon Sep 17 00:00:00 2001 From: Felix Kratz Date: Thu, 23 Dec 2021 15:04:51 +0100 Subject: [PATCH] add new text shadow documentation --- README.md | 9 +++++++++ src/text.c | 2 -- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2d27ab6..ecbe998 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,7 @@ Icon properties: * *icon.width*: Used to make the icon have a fixed custom width given in points (default: *dynamic*) * *icon.align*: Used to align icons when they have a fixed width (values: *center*, *left*, *right*, default: *left*) * *icon.background.\*: all background properties are also available for the icon +* *icon.shadow.\*: all shadow properties are available for the icon Label properties: * *label*: the label of the item @@ -196,6 +197,7 @@ Label properties: * *label.width*: Used to make the label have a fixed custom width given in points (default: *dynamic*) * *label.align*: Used to align labels when they have a fixed width (values: *center*, *left*, *right*, default: *left*) * *label.background.\*: all background properties are also available for the label +* *icon.shadow.\*: all shadow properties are available for the shadow Background properties: * *background.drawing*: wether the item should draw a background (values: *on*, *off*, *toggle*, default: *off*) @@ -218,6 +220,13 @@ Drawing properties: * *drawing*: If the item should be drawn into the bar (values: *on*, *off*, *toggle*, default: *on*) * *lazy*: Changes do not trigger a redraw of the bar, item is refreshed when the bar is redrawn anyways (values: *on*, *off*, *toggle*, default: *off*) +Shadow properties (Only on HEAD currently): +* *shadow.drawing*: If the shadow should be drawn (values: *on*, *off*, *toggle*, default: *off*) +* *shadow.angle*: The angle of the shadow (between 0 and 360, default: 30) +* *shadow.distance*: The distance of the shadow (default: 5) +* *shadow.color*: The color of the shadow (default: 0xff000000) + + ### Changing the default values for all further items It is possible to change the *defaults* at every point in the configuration. All item created *after* changing the defaults will inherit these properties from the default item. diff --git a/src/text.c b/src/text.c index a56f6f9..7d473e1 100644 --- a/src/text.c +++ b/src/text.c @@ -159,10 +159,8 @@ void text_draw(struct text* text, CGContextRef context) { background_draw(&text->background, context); if (text->shadow.enabled) { - printf("Drawing shadow\n"); CGContextSetRGBFillColor(context, text->shadow.color.r, text->shadow.color.g, text->shadow.color.b, text->shadow.color.a); CGRect bounds = shadow_get_bounds(&text->shadow, text->bounds); - printf("At: %f %f \n", bounds.origin.x, bounds.origin.y); CGContextSetTextPosition(context, bounds.origin.x + text->padding_left, bounds.origin.y + text->y_offset); CTLineDraw(text->line.line, context); }