aboutsummaryrefslogtreecommitdiff
path: root/swaybar/render.c
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2018-10-20 22:52:56 +0200
committerFurkan Sahin <furkan-dev@proton.me>2018-10-20 22:52:56 +0200
commit99089f0cb4982c73f98c59eb9bd7681de6278c5d (patch)
tree55fe01811bc8ac0785ce9798335bfd15553fa708 /swaybar/render.c
parent49d158e6aeb2a27868d68af295d3848548144291 (diff)
parent5c62a98a9494ac69769a4509ad049e66b9e0e54d (diff)
Merge pull request #2901 from ianyfan/swaybar1.0-beta.1
swaybar: render with minimum height, nominally text height
Diffstat (limited to 'swaybar/render.c')
-rw-r--r--swaybar/render.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index 097eb462..85e7542f 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -448,7 +448,9 @@ static uint32_t render_to_cairo(cairo_t *cairo, struct swaybar_output *output) {
}
cairo_paint(cairo);
- uint32_t max_height = 0;
+ int th;
+ get_text_size(cairo, config->font, NULL, &th, NULL, output->scale, false, "");
+ uint32_t max_height = (th + WS_VERTICAL_PADDING * 4) / output->scale;
/*
* Each render_* function takes the actual height of the bar, and returns
* the ideal height. If the actual height is too short, the render function