diff options
author | nicm <nicm> | 2021-03-11 06:41:04 +0000 |
---|---|---|
committer | nicm <nicm> | 2021-03-11 06:41:04 +0000 |
commit | 3eb91efba160eff0b077a5fee902edb632f7fdca (patch) | |
tree | 790d6916f3b921043d6b9e5408e3b9a2b3f377c2 /style.c | |
parent | d98f9f7fe56beefeb294184ffaed24b7ea510a97 (diff) | |
download | rtmux-3eb91efba160eff0b077a5fee902edb632f7fdca.tar.gz rtmux-3eb91efba160eff0b077a5fee902edb632f7fdca.tar.bz2 rtmux-3eb91efba160eff0b077a5fee902edb632f7fdca.zip |
Add an "absolute-centre" alignment to use the centre of the total space
instead of only the available space. From Magnus Gross in GitHub issue 2578.
Diffstat (limited to 'style.c')
-rw-r--r-- | style.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -139,6 +139,8 @@ style_parse(struct style *sy, const struct grid_cell *base, const char *in) sy->align = STYLE_ALIGN_CENTRE; else if (strcasecmp(tmp + 6, "right") == 0) sy->align = STYLE_ALIGN_RIGHT; + else if (strcasecmp(tmp + 6, "absolute-centre") == 0) + sy->align = STYLE_ALIGN_ABSOLUTE_CENTRE; else goto error; } else if (end > 5 && strncasecmp(tmp, "fill=", 5) == 0) { @@ -227,6 +229,8 @@ style_tostring(struct style *sy) tmp = "centre"; else if (sy->align == STYLE_ALIGN_RIGHT) tmp = "right"; + else if (sy->align == STYLE_ALIGN_ABSOLUTE_CENTRE) + tmp = "absolute-centre"; off += xsnprintf(s + off, sizeof s - off, "%salign=%s", comma, tmp); comma = ","; |