aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/render.c
diff options
context:
space:
mode:
authorLibravatar Dmitri Kourennyi <dkour@mykolab.com>2019-04-01 16:13:39 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-04-04 14:14:08 -0600
commit4b892a79aae47ef2a7a4776e959eca612e0df08b (patch)
treec3d538d796104a130ce729c939af47d65eec71d3 /swaybar/render.c
parentEnsure predicted position for short text handling doesn't overflow. (diff)
downloadsway-4b892a79aae47ef2a7a4776e959eca612e0df08b.tar.gz
sway-4b892a79aae47ef2a7a4776e959eca612e0df08b.tar.zst
sway-4b892a79aae47ef2a7a4776e959eca612e0df08b.zip
Add margin to short_text handling.
Add a 3xscale margin matching other spacing in swaybar as part of short text width calculations
Diffstat (limited to 'swaybar/render.c')
-rw-r--r--swaybar/render.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index a0200f0d..e17c13a8 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -453,10 +453,10 @@ static uint32_t render_status_line_i3bar(cairo_t *cairo,
453 struct i3bar_block *block; 453 struct i3bar_block *block;
454 bool use_short_text = false; 454 bool use_short_text = false;
455 455
456 // TODO: Add margin here?
457 double reserved_width = 456 double reserved_width =
458 predict_workspace_buttons_length(cairo, output) + 457 predict_workspace_buttons_length(cairo, output) +
459 predict_binding_mode_indicator_length(cairo, output); 458 predict_binding_mode_indicator_length(cairo, output) +
459 3 * output->scale; // require a bit of space for margin
460 460
461 double predicted_full_pos = 461 double predicted_full_pos =
462 predict_status_line_pos(cairo, output, *x); 462 predict_status_line_pos(cairo, output, *x);