x11_draw_rect(x, Palette[EditBg], 0, 0, x->width, x->height);
x11_draw_rect(x, Palette[TagsBg], 0, 0, x->width, fheight + 4);
x11_draw_rect(x, Palette[HorBdr], 0, fheight + 4, x->width, 1);
+
+ XGlyphInfo glyphinfo;
+ XftTextExtentsUtf8 (x->display, x->font, (const FcChar8*)Query, strlen(Query), &glyphinfo);
+ int offset = 0;
+ if (glyphinfo.width >= (x->width - 4))
+ offset = ((x->width - 4) - glyphinfo.width);
+ XftColor clr;
+ xftcolor(x, &clr, Palette[TagsFg]);
+ XftDrawStringUtf8(x->xft, &clr, x->font, offset + 2, fheight, (const FcChar8*)Query, strlen(Query));
+ XftColorFree(x->display, x->visual, x->colormap, &clr);
+
x11_flip(x);
}
| ButtonPressMask
| ExposureMask
);
+ x11_init_gc(&x);
+ x11_centerwin(&x);
if (!(x.font = x11_font_load(&x, Fonts[0]))) {
perror("unable to load base font");
exit(EXIT_FAILURE);
}
- x11_init_gc(&x);
- x11_centerwin(&x);
x11_show(&x);
x.eventfns[KeyPress] = xkeypress;
x.eventfns[ButtonPress] = xbtnpress;