X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=mod_statusbar%2Fdraw.c;h=639295f7b08c18d68a6fe3ea668e2377bf8646f1;hb=ae4260bb64817c11f9a7140324cd3e3ba113e297;hp=29e9f0230a093be52c260e1a580d5489d084e732;hpb=8366314611bf30a0f31d25bf5f5023186fa87692;p=ion3.git diff --git a/mod_statusbar/draw.c b/mod_statusbar/draw.c index 29e9f02..639295f 100644 --- a/mod_statusbar/draw.c +++ b/mod_statusbar/draw.c @@ -1,12 +1,9 @@ /* * ion/mod_statusbar/draw.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * - * Ion is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. + * See the included file LICENSE for details. */ #include @@ -109,7 +106,7 @@ void statusbar_calculate_xs(WStatusBar *sb) static void draw_elems(GrBrush *brush, WRectangle *g, int ty, WSBElem *elems, int nelems, bool needfill, - const char *dfltattr, bool complete) + bool complete) { int prevx=g->x; int maxx=g->x+g->w; @@ -125,8 +122,15 @@ static void draw_elems(GrBrush *brush, WRectangle *g, int ty, const char *s=(elems->text!=NULL ? elems->text : STATUSBAR_NX_STR); - grbrush_draw_string(brush, elems->x, ty, s, strlen(s), needfill, - elems->attr ? elems->attr : dfltattr); + + grbrush_set_attr(brush, elems->attr); + grbrush_set_attr(brush, elems->meter); + + grbrush_draw_string(brush, elems->x, ty, s, strlen(s), needfill); + + grbrush_unset_attr(brush, elems->meter); + grbrush_unset_attr(brush, elems->attr); + prevx=elems->x+elems->text_w; } elems++; @@ -162,7 +166,7 @@ void statusbar_draw(WStatusBar *sb, bool complete) grbrush_begin(sb->brush, &g, (complete ? 0 : GRBRUSH_NO_CLEAR_OK)); - grbrush_draw_border(sb->brush, &g, NULL); + grbrush_draw_border(sb->brush, &g); if(sb->elems==NULL) return; @@ -174,8 +178,7 @@ void statusbar_draw(WStatusBar *sb, bool complete) ty=(g.y+fnte.baseline+(g.h-fnte.max_height)/2); - draw_elems(sb->brush, &g, ty, sb->elems, sb->nelems, - TRUE, NULL, complete); + draw_elems(sb->brush, &g, ty, sb->elems, sb->nelems, TRUE, complete); grbrush_end(sb->brush); }