From 6016ff8658c53fca30b1ee530bea9c469f2cce84 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 6 Apr 2003 06:16:19 +0000 Subject: add the ability to render and size text labels for non-window-decorations --- engines/openbox/obrender.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'engines/openbox/obrender.c') 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; +} -- cgit v1.2.3