Merge pull request #165 from JeromeBon/feature_issue161_default_underline_color

Implement [Issue #161 - Feature request]
This commit is contained in:
Giuseppe 2016-01-19 15:18:14 +01:00
commit c788534107
2 changed files with 10 additions and 6 deletions

View File

@ -6,7 +6,7 @@ lemonbar - Featherweight lemon-scented bar
=head1 SYNOPSIS =head1 SYNOPSIS
I<lemonbar> [-h | -g I<width>B<x>I<height>B<+>I<x>B<+>I<y> | -b | -d | -f I<font> | -p | -n I<name> | -u I<pixel> | -B I<color> | -F I<color>] I<lemonbar> [-h | -g I<width>B<x>I<height>B<+>I<x>B<+>I<y> | -b | -d | -f I<font> | -p | -n I<name> | -u I<pixel> | -B I<color> | -F I<color> | -U I<color>]
=head1 DESCRIPTION =head1 DESCRIPTION
@ -61,6 +61,10 @@ Set the background color of the bar. I<color> must be specified in the hex forma
Set the foreground color of the bar. Accepts the same color formats as B<-B>. Set the foreground color of the bar. Accepts the same color formats as B<-B>.
=item B<-U> I<color>
Set the underline color of the bar. Accepts the same color formats as B<-B>.
=back =back
=head1 FORMATTING =head1 FORMATTING

View File

@ -95,7 +95,7 @@ static bool topbar = true;
static int bw = -1, bh = -1, bx = 0, by = 0; static int bw = -1, bh = -1, bx = 0, by = 0;
static int bu = 1; // Underline height static int bu = 1; // Underline height
static rgba_t fgc, bgc, ugc; static rgba_t fgc, bgc, ugc;
static rgba_t dfgc, dbgc; static rgba_t dfgc, dbgc, dugc;
static area_stack_t area_stack; static area_stack_t area_stack;
void void
@ -520,7 +520,7 @@ parse (char *text)
case 'B': bgc = parse_color(p, &p, dbgc); update_gc(); break; case 'B': bgc = parse_color(p, &p, dbgc); update_gc(); break;
case 'F': fgc = parse_color(p, &p, dfgc); update_gc(); break; case 'F': fgc = parse_color(p, &p, dfgc); update_gc(); break;
case 'U': ugc = parse_color(p, &p, dbgc); update_gc(); break; case 'U': ugc = parse_color(p, &p, dugc); update_gc(); break;
case 'S': case 'S':
if (*p == '+' && cur_mon->next) if (*p == '+' && cur_mon->next)
@ -1238,8 +1238,7 @@ main (int argc, char **argv)
// B/W combo // B/W combo
dbgc = bgc = (rgba_t)0x00000000U; dbgc = bgc = (rgba_t)0x00000000U;
dfgc = fgc = (rgba_t)0xffffffffU; dfgc = fgc = (rgba_t)0xffffffffU;
dugc = ugc = fgc;
ugc = fgc;
// A safe default // A safe default
areas = 10; areas = 10;
@ -1248,7 +1247,7 @@ main (int argc, char **argv)
// Connect to the Xserver and initialize scr // Connect to the Xserver and initialize scr
xconn(); xconn();
while ((ch = getopt(argc, argv, "hg:bdf:a:pu:B:F:n:")) != -1) { while ((ch = getopt(argc, argv, "hg:bdf:a:pu:B:F:U:n:")) != -1) {
switch (ch) { switch (ch) {
case 'h': case 'h':
printf ("lemonbar version %s\n", VERSION); printf ("lemonbar version %s\n", VERSION);
@ -1274,6 +1273,7 @@ main (int argc, char **argv)
case 'u': bu = strtoul(optarg, NULL, 10); break; case 'u': bu = strtoul(optarg, NULL, 10); break;
case 'B': dbgc = bgc = parse_color(optarg, NULL, (rgba_t)0x00000000U); break; case 'B': dbgc = bgc = parse_color(optarg, NULL, (rgba_t)0x00000000U); break;
case 'F': dfgc = fgc = parse_color(optarg, NULL, (rgba_t)0xffffffffU); break; case 'F': dfgc = fgc = parse_color(optarg, NULL, (rgba_t)0xffffffffU); break;
case 'U': dugc = ugc = parse_color(optarg, NULL, fgc); break;
case 'a': areas = strtoul(optarg, NULL, 10); break; case 'a': areas = strtoul(optarg, NULL, 10); break;
} }
} }