self->size.width = 1;
self->item_h = 1;
+ if (self->a_title == NULL) {
+ XSetWindowBorderWidth(ob_display, self->frame, ob_rr_theme->bwidth);
+ XSetWindowBackground(ob_display, self->frame,
+ ob_rr_theme->b_color->pixel);
+ XSetWindowBorderWidth(ob_display, self->title, ob_rr_theme->bwidth);
+ XSetWindowBorder(ob_display, self->frame, ob_rr_theme->b_color->pixel);
+ XSetWindowBorder(ob_display, self->title, ob_rr_theme->b_color->pixel);
+
+ self->a_title = RrAppearanceCopy(ob_rr_theme->a_menu_title);
+ self->a_items = RrAppearanceCopy(ob_rr_theme->a_menu);
+ }
+
/* set texture data and size them mofos out */
if (self->label) {
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 += theme_bevel * 2;
- self->title_h += theme_bevel * 2;
+ 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);
}
MenuEntry *e = it->data;
int h;
+ if (e->a_item == NULL) {
+ e->a_item = RrAppearanceCopy(ob_rr_theme->a_menu_item);
+ e->a_disabled = RrAppearanceCopy(ob_rr_theme->a_menu_disabled);
+ e->a_hilite = RrAppearanceCopy(ob_rr_theme->a_menu_hilite);
+ }
+
e->a_item->texture[0].data.text.string = e->label;
RrMinsize(e->a_item, &e->min_w, &self->item_h);
self->size.width = MAX(self->size.width, e->min_w);
self->item_h = MAX(self->item_h, h);
self->size.width = MAX(self->size.width, e->min_w);
- e->min_w += theme_bevel * 2;
+ e->min_w += ob_rr_theme->bevel * 2;
++nitems;
}
- self->bullet_w = self->item_h + theme_bevel;
- self->size.width += 2 * self->bullet_w + 2 * theme_bevel;
- self->item_h += theme_bevel * 2;
+ self->bullet_w = self->item_h + ob_rr_theme->bevel;
+ self->size.width += 2 * self->bullet_w + 2 * ob_rr_theme->bevel;
+ self->item_h += ob_rr_theme->bevel * 2;
items_h = self->item_h * MAX(nitems, 1);
XResizeWindow(ob_display, self->frame, self->size.width,
MAX(self->title_h + items_h, 1));
if (self->label)
- XMoveResizeWindow(ob_display, self->title, -theme_bwidth,
- -theme_bwidth, self->size.width, self->title_h);
+ XMoveResizeWindow(ob_display, self->title, -ob_rr_theme->bwidth,
+ -ob_rr_theme->bwidth,
+ self->size.width, self->title_h);
XMoveResizeWindow(ob_display, self->items, 0,
- self->title_h + theme_bwidth, self->size.width,
+ self->title_h + ob_rr_theme->bwidth, self->size.width,
items_h);
if (self->label)