Added a way to reset the bg/fg color.

This commit is contained in:
LemonBoy
2012-07-16 11:56:09 +02:00
parent fbaf85f480
commit fcf64daac8
2 changed files with 5 additions and 2 deletions

6
bar.c
View File

@@ -67,8 +67,10 @@ parse (char *text)
switch (*p++) {
case 0x0: return; /* EOL */
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 'b': if (isdigit (*p)) xcb_change_gc (c, gc, XCB_GC_BACKGROUND, (const uint32_t []){ pal[*p-'0'] }); p++; break;
case 'f': if (*p == 'r') *p = '1'; if (isdigit (*p))
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 'c': align = 1; pos_x = 0; break;
case 'r': align = 2; pos_x = 0; break;