RrAppearanceCopy(ob_rr_theme->a_menu_text_disabled);
self->a_text_selected =
RrAppearanceCopy(ob_rr_theme->a_menu_text_selected);
+ self->a_text_title =
+ RrAppearanceCopy(ob_rr_theme->a_menu_text_title);
return self;
}
RrAppearanceFree(self->a_text_normal);
RrAppearanceFree(self->a_text_disabled);
RrAppearanceFree(self->a_text_selected);
+ RrAppearanceFree(self->a_text_title);
RrAppearanceFree(self->a_bullet_normal);
RrAppearanceFree(self->a_bullet_selected);
case OB_MENU_ENTRY_TYPE_SEPARATOR:
if (self->entry->data.separator.label) {
item_a = self->frame->a_title;
- item_a->texture[0].data.text.string =
- self->entry->data.separator.label;
- th = self->frame->title_h;
+ th = ob_rr_theme->menu_title_height;
} else {
item_a = self->a_normal;
th = SEPARATOR_HEIGHT + 2*PADDING;
text_a->texture[0].data.text.string = sub ? sub->title : "";
break;
case OB_MENU_ENTRY_TYPE_SEPARATOR:
- text_a = self->a_text_normal;
+ if (self->entry->data.separator.label != NULL)
+ text_a = self->a_text_title;
+ else
+ text_a = self->a_text_normal;
break;
}
self->frame->item_h - 2*PADDING);
break;
case OB_MENU_ENTRY_TYPE_SEPARATOR:
- if (self->entry->data.separator.label == NULL) {
+ if (self->entry->data.separator.label != NULL) {
+ /* labeled separator */
+ XMoveResizeWindow(ob_display, self->text,
+ ob_rr_theme->paddingx, ob_rr_theme->paddingy,
+ self->area.width - 2*ob_rr_theme->paddingx,
+ ob_rr_theme->menu_title_height -
+ 2*ob_rr_theme->paddingy);
+ text_a->surface.parent = item_a;
+ text_a->surface.parentx = ob_rr_theme->paddingx;
+ text_a->surface.parenty = ob_rr_theme->paddingy;
+ RrPaint(text_a, self->text,
+ self->area.width - 2*ob_rr_theme->paddingx,
+ ob_rr_theme->menu_title_height -
+ 2*ob_rr_theme->paddingy);
+ } else {
+ /* unlabeled separaator */
XMoveResizeWindow(ob_display, self->text, PADDING, PADDING,
self->area.width - 2*PADDING, SEPARATOR_HEIGHT);
self->a_separator->surface.parent = item_a;
th += 2*PADDING;
self->item_h = th;
- self->a_title->texture[0].data.text.string = "";
- RrMinsize(self->a_title, &tw, &th);
- tw += 2*PADDING;
- th += 2*PADDING;
- self->title_h = th;
-
RrMargins(e->a_normal, &l, &t, &r, &b);
STRUT_SET(self->item_margin,
MAX(self->item_margin.left, l),
break;
case OB_MENU_ENTRY_TYPE_SEPARATOR:
if (e->entry->data.separator.label != NULL) {
- self->a_title->texture[0].data.text.string =
+ e->a_text_title->texture[0].data.text.string =
e->entry->data.separator.label;
- RrMinsize(self->a_title, &tw, &th);
+ RrMinsize(e->a_text_title, &tw, &th);
tw = MIN(tw, MAX_MENU_WIDTH);
- th += ob_rr_theme->mbwidth * 2;
+ th = ob_rr_theme->menu_title_height +
+ (ob_rr_theme->mbwidth - PADDING) *2;
} else {
tw = 0;
th = SEPARATOR_HEIGHT;
theme->a_focused_handle = RrAppearanceNew(inst, 0);
theme->a_unfocused_handle = RrAppearanceNew(inst, 0);
theme->a_menu = RrAppearanceNew(inst, 0);
- theme->a_menu_title = RrAppearanceNew(inst, 1);
+ theme->a_menu_title = RrAppearanceNew(inst, 0);
+ theme->a_menu_text_title = RrAppearanceNew(inst, 1);
theme->a_menu_normal = RrAppearanceNew(inst, 0);
theme->a_menu_disabled = RrAppearanceNew(inst, 0);
theme->a_menu_selected = RrAppearanceNew(inst, 0);
set_default_appearance(theme->a_unfocused_grip);
if (!FIND(appearance, L("menu","entries"), theme->a_menu, FALSE))
set_default_appearance(theme->a_menu);
- if (!FIND(appearance, L("menu","title"), theme->a_menu_title, FALSE))
+ if (!FIND(appearance, L("menu","title"), theme->a_menu_title, TRUE))
set_default_appearance(theme->a_menu_title);
if (!FIND(appearance, L("menu", "active"), theme->a_menu_selected, TRUE))
set_default_appearance(theme->a_menu_selected);
theme->a_icon->surface.grad =
theme->a_clear->surface.grad =
theme->a_clear_tex->surface.grad =
+ theme->a_menu_text_title->surface.grad =
theme->a_menu_normal->surface.grad =
theme->a_menu_disabled->surface.grad =
theme->a_menu_text_normal->surface.grad =
theme->a_unfocused_label->texture[0].data.text.shadow_alpha =
theme->title_unfocused_shadow_alpha;
- theme->a_menu_title->texture[0].type = RR_TEXTURE_TEXT;
- theme->a_menu_title->texture[0].data.text.justify = mtitlejust;
- theme->a_menu_title->texture[0].data.text.font = theme->menu_title_font;
- theme->a_menu_title->texture[0].data.text.color = theme->menu_title_color;
+ theme->a_menu_text_title->texture[0].type = RR_TEXTURE_TEXT;
+ theme->a_menu_text_title->texture[0].data.text.justify = mtitlejust;
+ theme->a_menu_text_title->texture[0].data.text.font =
+ theme->menu_title_font;
+ theme->a_menu_text_title->texture[0].data.text.color =
+ theme->menu_title_color;
if (!FIND(shadow, L("menu","title","text","shadow","offset"),
- theme->a_menu_title))
- theme->a_menu_title->texture[0].data.text.shadow_offset_x =
- theme->a_menu_title->texture[0].data.text.shadow_offset_y = 0;
- theme->a_menu_title->texture[0].data.text.shadow_color =
+ theme->a_menu_text_title))
+ theme->a_menu_text_title->texture[0].data.text.shadow_offset_x =
+ theme->a_menu_text_title->texture[0].data.text.shadow_offset_y = 0;
+ theme->a_menu_text_title->texture[0].data.text.shadow_color =
theme->menu_title_shadow_color;
- theme->a_menu_title->texture[0].data.text.shadow_alpha =
+ theme->a_menu_text_title->texture[0].data.text.shadow_alpha =
theme->menu_title_shadow_alpha;
theme->a_menu_text_normal->texture[0].type =
MAX(theme->win_font_height,
RrFontHeight(theme->win_font_unfocused,
a->texture[0].data.text.shadow_offset_y));
- a = theme->a_menu_title;
+ a = theme->a_menu_text_title;
theme->menu_title_font_height =
RrFontHeight(theme->menu_title_font,
a->texture[0].data.text.shadow_offset_y);
RrAppearanceFree(theme->a_unfocused_handle);
RrAppearanceFree(theme->a_menu);
RrAppearanceFree(theme->a_menu_title);
+ RrAppearanceFree(theme->a_menu_text_title);
RrAppearanceFree(theme->a_menu_normal);
RrAppearanceFree(theme->a_menu_disabled);
RrAppearanceFree(theme->a_menu_selected);