Added a way to reset the bg/fg color.
This commit is contained in:
parent
fbaf85f480
commit
fcf64daac8
|
@ -20,6 +20,7 @@ To draw a backslash just backslash escape it (\\\\).
|
||||||
```
|
```
|
||||||
f<0-9> Selects the text foreground color from the palette.
|
f<0-9> Selects the text foreground color from the palette.
|
||||||
b<0-9> Selects the text background color from the palette.
|
b<0-9> Selects the text background color from the palette.
|
||||||
|
To reset the bg/fg color just pass 'r' as color index.
|
||||||
|
|
||||||
l Aligns the text to the left.
|
l Aligns the text to the left.
|
||||||
c Aligns the text to the center.
|
c Aligns the text to the center.
|
||||||
|
|
6
bar.c
6
bar.c
|
@ -67,8 +67,10 @@ parse (char *text)
|
||||||
switch (*p++) {
|
switch (*p++) {
|
||||||
case 0x0: return; /* EOL */
|
case 0x0: return; /* EOL */
|
||||||
case 0xA: return; /* NL */
|
case 0xA: return; /* NL */
|
||||||
case 'f': if (isdigit (*p)) xcb_change_gc (c, gc, XCB_GC_FOREGROUND, (const uint32_t []){ pal[*p-'0'] }); p++; break;
|
case 'f': if (*p == 'r') *p = '1'; if (isdigit (*p))
|
||||||
case 'b': if (isdigit (*p)) xcb_change_gc (c, gc, XCB_GC_BACKGROUND, (const uint32_t []){ pal[*p-'0'] }); p++; break;
|
xcb_change_gc (c, gc, XCB_GC_FOREGROUND, (const uint32_t []){ pal[*p-'0'] }); p++; break;
|
||||||
|
case 'b': if (*p == 'r') *p = '0'; if (isdigit (*p))
|
||||||
|
xcb_change_gc (c, gc, XCB_GC_BACKGROUND, (const uint32_t []){ pal[*p-'0'] }); p++; break;
|
||||||
case 'l': align = 0; pos_x = 0; break;
|
case 'l': align = 0; pos_x = 0; break;
|
||||||
case 'c': align = 1; pos_x = 0; break;
|
case 'c': align = 1; pos_x = 0; break;
|
||||||
case 'r': align = 2; pos_x = 0; break;
|
case 'r': align = 2; pos_x = 0; break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user