summaryrefslogtreecommitdiff
path: root/openbox/menu_render.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-08-14 06:53:41 +0000
committerDana Jansens <danakj@orodu.net>2003-08-14 06:53:41 +0000
commit948c549d9df7c1bf54e8ae487cb96a9ae413c2cf (patch)
tree7469665f23bd2419fe375e925c72fe3fd74f41e4 /openbox/menu_render.c
parent12af0aedf2da4f360954cfaaeaf77234b36e4858 (diff)
dont show titles on submenus. kill the extra 1px at the top of titleless menus
Diffstat (limited to 'openbox/menu_render.c')
-rw-r--r--openbox/menu_render.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/openbox/menu_render.c b/openbox/menu_render.c
index 8759a1b9..1f03459c 100644
--- a/openbox/menu_render.c
+++ b/openbox/menu_render.c
@@ -29,13 +29,14 @@ void menu_render(ObMenu *self) {
}
/* set texture data and size them mofos out */
- if (self->label) {
+ if (self->label && !(self->parent && self->parent->shown)) {
self->a_title->texture[0].data.text.string = self->label;
RrMinsize(self->a_title, &self->title_min_w, &self->title_h);
self->title_min_w += ob_rr_theme->bevel * 2;
self->title_h += ob_rr_theme->bevel * 2;
self->size.width = MAX(self->size.width, self->title_min_w);
- }
+ } else
+ self->title_h = -ob_rr_theme->bwidth;
for (it = self->entries; it; it = it->next) {
ObMenuEntry *e = it->data;
@@ -72,16 +73,19 @@ void menu_render(ObMenu *self) {
self->size.height = MAX(self->title_h + items_h + ob_rr_theme->bwidth, 1);
XResizeWindow(ob_display, self->frame, self->size.width,self->size.height);
- if (self->label)
+ if (self->label && !(self->parent && self->parent->shown)) {
XMoveResizeWindow(ob_display, self->title, -ob_rr_theme->bwidth,
-ob_rr_theme->bwidth,
self->size.width, self->title_h);
+ XMapWindow(ob_display, self->title);
+ } else
+ XUnmapWindow(ob_display, self->title);
XMoveResizeWindow(ob_display, self->items, 0,
self->title_h + ob_rr_theme->bwidth, self->size.width,
items_h);
- if (self->label)
+ if (self->label && !(self->parent && self->parent->shown))
RrPaint(self->a_title, self->title, self->size.width, self->title_h);
RrPaint(self->a_items, self->items, self->size.width, items_h);