- XRectangle r = { b->x, b->y, b->w, b->h };
-
- XSetForeground(dpy, b->gc, b->bg);
- XFillRectangles(dpy, b->drawable, b->gc, &r, 1);
-
- w = 0;
- if(border)
- drawborder(dpy, b);
-
- if(!text)
- return;
-
- len = strlen(text);
- if(len >= sizeof(buf))
- len = sizeof(buf) - 1;
- memcpy(buf, text, len);
- buf[len] = 0;
-
- h = b->font.ascent + b->font.descent;
- y = b->y + (b->h / 2) - (h / 2) + b->font.ascent;
- x = b->x + (h / 2);
-
- /* shorten text if necessary */
- while(len && (w = textnw(&b->font, buf, len)) > b->w - h)
- buf[--len] = 0;
-
- if(w > b->w)
- return; /* too long */
-
- gcv.foreground = b->fg;
- gcv.background = b->bg;
- if(b->font.set) {
- XChangeGC(dpy, b->gc, GCForeground | GCBackground, &gcv);
- XmbDrawImageString(dpy, b->drawable, b->font.set, b->gc,
- x, y, buf, len);
+ XRectangle r = { dc.x, dc.y, dc.w, dc.h };
+
+ gcv.foreground = col[ColFG];
+ XChangeGC(dpy, dc.gc, GCForeground, &gcv);
+ x = (dc.font.ascent + dc.font.descent + 2) / 4;
+ r.x = dc.x + 1;
+ r.y = dc.y + 1;
+ if(filled) {
+ r.width = r.height = x + 1;
+ XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);