summaryrefslogtreecommitdiff
path: root/engines/openbox/obrender.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-04-06 06:16:19 +0000
committerDana Jansens <danakj@orodu.net>2003-04-06 06:16:19 +0000
commit6016ff8658c53fca30b1ee530bea9c469f2cce84 (patch)
tree05d6c7189681dd0e908d93d47ffd34493e56927a /engines/openbox/obrender.c
parentaf21cb131a784b3d76e9930421a3595f5819dc71 (diff)
add the ability to render and size text labels for non-window-decorations
Diffstat (limited to 'engines/openbox/obrender.c')
-rw-r--r--engines/openbox/obrender.c30
1 files changed, 30 insertions, 0 deletions
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;
+}