/*
* ion/mod_statusbar/draw.c
*
- * Copyright (c) Tuomo Valkonen 1999-2006.
+ * Copyright (c) Tuomo Valkonen 1999-2008.
*
- * 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 <string.h>
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;
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++;
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;
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);
}