X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=engines%2Fopenbox%2Fobrender.c;h=c765ef761e2fdde8d73b345d94e936629d39ad53;hb=6016ff8658c53fca30b1ee530bea9c469f2cce84;hp=a609376f68ce9a0cbdb6b2d78dc47a1505f173f5;hpb=af21cb131a784b3d76e9930421a3595f5819dc71;p=chaz%2Fopenbox diff --git a/engines/openbox/obrender.c b/engines/openbox/obrender.c index a609376f..c765ef76 100644 --- a/engines/openbox/obrender.c +++ b/engines/openbox/obrender.c @@ -202,3 +202,33 @@ static void obrender_close(ObFrame *self, Appearance *a) RECT_SET(a->texture[0].position, 0, 0, BUTTON_SIZE,BUTTON_SIZE); paint(self->close, a); } + +void render_label(Window win, Rect *area, char *text, + gboolean hilight, gboolean toplevel) +{ + Appearance *a; + + a = hilight ? ob_app_hilite_label : ob_app_unhilite_label; + a->texture[0].data.text.string = text; + RECT_SET(a->area, 0, 0, area->width, area->height); + a->texture[0].position = a->area; + + if (toplevel) { + XSetWindowBorderWidth(ob_display, win, ob_s_bwidth); + XSetWindowBorder(ob_display, win, ob_s_b_color->pixel); + } + + paint(win, a); +} + +void size_label(char *text, gboolean hilight, gboolean toplevel, Size *s) +{ + Appearance *a; + + a = hilight ? ob_app_hilite_label : ob_app_unhilite_label; + a->texture[0].data.text.string = text; + + appearance_minsize(a, s); + s->width += ob_s_bevel * 2; + s->height += ob_s_bevel * 2; +}