diff options
author | Thomas Adam <thomas@xteddy.org> | 2019-07-01 09:02:25 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2019-07-01 09:02:25 +0100 |
commit | b9fbf02ad500cd6dfc4d697fc26c7d571508ec5c (patch) | |
tree | 5a2f3d5988dd0027133300348b02311fd1057f50 /style.c | |
parent | abcd4bd24662e79a7ae936c5d2c971417864c519 (diff) | |
parent | 2da050413c17e587be8bede710112096ce6b5f5a (diff) | |
download | rtmux-b9fbf02ad500cd6dfc4d697fc26c7d571508ec5c.tar.gz rtmux-b9fbf02ad500cd6dfc4d697fc26c7d571508ec5c.tar.bz2 rtmux-b9fbf02ad500cd6dfc4d697fc26c7d571508ec5c.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'style.c')
-rw-r--r-- | style.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -32,6 +32,7 @@ static struct style style_default = { { 0, 0, 8, 8, 0, { { ' ' }, 0, 1, 1 } }, + 8, STYLE_ALIGN_DEFAULT, STYLE_LIST_OFF, @@ -127,6 +128,10 @@ style_parse(struct style *sy, const struct grid_cell *base, const char *in) sy->align = STYLE_ALIGN_RIGHT; else goto error; + } else if (end > 5 && strncasecmp(tmp, "fill=", 5) == 0) { + if ((value = colour_fromstring(tmp + 5)) == -1) + goto error; + sy->fill = value; } else if (end > 3 && strncasecmp(tmp + 1, "g=", 2) == 0) { if ((value = colour_fromstring(tmp + 3)) == -1) goto error; @@ -213,6 +218,11 @@ style_tostring(struct style *sy) tmp); comma = ","; } + if (sy->fill != 8) { + off += xsnprintf(s + off, sizeof s - off, "%sfill=%s", comma, + colour_tostring(sy->fill)); + comma = ","; + } if (gc->fg != 8) { off += xsnprintf(s + off, sizeof s - off, "%sfg=%s", comma, colour_tostring(gc->fg)); @@ -290,6 +300,8 @@ style_equal(struct style *sy1, struct style *sy2) return (0); if ((gc1->attr & STYLE_ATTR_MASK) != (gc2->attr & STYLE_ATTR_MASK)) return (0); + if (sy1->fill != sy2->fill) + return (0); if (sy1->align != sy2->align) return (0); return (1); |