aboutsummaryrefslogtreecommitdiff
path: root/style.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2019-07-29 10:51:30 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2019-07-29 10:51:30 +0100
commitda552eb73b80bab3c0a28dfb9ae2c75fa6d4bdaf (patch)
treecf9c86c3218659faf46e606a1e38bc6ebb570dcd /style.c
parent5a501a8ae27c2d0128870caa48c5708e97528567 (diff)
parentb90a9fcd13f4434aed0fe1785d619aa668bbc77d (diff)
downloadrtmux-da552eb73b80bab3c0a28dfb9ae2c75fa6d4bdaf.tar.gz
rtmux-da552eb73b80bab3c0a28dfb9ae2c75fa6d4bdaf.tar.bz2
rtmux-da552eb73b80bab3c0a28dfb9ae2c75fa6d4bdaf.zip
Merge branch 'master' into 3.0-rc
Diffstat (limited to 'style.c')
-rw-r--r--style.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/style.c b/style.c
index ce78175a..9f986314 100644
--- a/style.c
+++ b/style.c
@@ -30,8 +30,9 @@
/* Default style. */
static struct style style_default = {
- { 0, 0, 8, 8, { { ' ' }, 0, 1, 1 } },
+ { { { ' ' }, 0, 1, 1 }, 0, 0, 8, 8, 0 },
+ 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);