- XMoveResizeWindow(ob_display, self->icon, PADDING, 0,
- self->frame->item_h,
- self->frame->item_h);
- self->a_icon->texture[0].data.rgba.width =
- self->entry->data.normal.icon_width;
- self->a_icon->texture[0].data.rgba.height =
- self->entry->data.normal.icon_height;
- self->a_icon->texture[0].data.rgba.data =
- self->entry->data.normal.icon_data;
- self->a_icon->surface.parent = item_a;
- self->a_icon->surface.parentx = PADDING;
- self->a_icon->surface.parenty = 0;
- RrPaint(self->a_icon, self->icon,
- self->frame->item_h, self->frame->item_h);
+ RrAppearance *clear;
+
+ XMoveResizeWindow(ob_display, self->icon,
+ PADDING, frame->item_margin.top,
+ ITEM_HEIGHT - frame->item_margin.top
+ - frame->item_margin.bottom,
+ ITEM_HEIGHT - frame->item_margin.top
+ - frame->item_margin.bottom);
+
+ clear = ob_rr_theme->a_clear_tex;
+ RrAppearanceClearTextures(clear);
+ clear->texture[0].type = RR_TEXTURE_IMAGE;
+ clear->texture[0].data.image.image =
+ self->entry->data.normal.icon;
+ clear->texture[0].data.image.alpha =
+ self->entry->data.normal.icon_alpha;
+ clear->surface.parent = item_a;
+ clear->surface.parentx = PADDING;
+ clear->surface.parenty = frame->item_margin.top;
+ RrPaint(clear, self->icon,
+ ITEM_HEIGHT - frame->item_margin.top
+ - frame->item_margin.bottom,
+ ITEM_HEIGHT - frame->item_margin.top
+ - frame->item_margin.bottom);
+ XMapWindow(ob_display, self->icon);
+ } else if (self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
+ self->entry->data.normal.mask)
+ {
+ RrColor *c;
+ RrAppearance *clear;
+
+ XMoveResizeWindow(ob_display, self->icon,
+ PADDING, frame->item_margin.top,
+ ITEM_HEIGHT - frame->item_margin.top
+ - frame->item_margin.bottom,
+ ITEM_HEIGHT - frame->item_margin.top
+ - frame->item_margin.bottom);
+
+ clear = ob_rr_theme->a_clear_tex;
+ RrAppearanceClearTextures(clear);
+ clear->texture[0].type = RR_TEXTURE_MASK;
+ clear->texture[0].data.mask.mask =
+ self->entry->data.normal.mask;
+
+ c = (self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
+ !self->entry->data.normal.enabled ?
+ /* disabled */
+ (self == self->frame->selected ?
+ self->entry->data.normal.mask_disabled_selected_color :
+ self->entry->data.normal.mask_disabled_color) :
+ /* enabled */
+ (self == self->frame->selected ?
+ self->entry->data.normal.mask_selected_color :
+ self->entry->data.normal.mask_normal_color));
+ clear->texture[0].data.mask.color = c;
+
+ clear->surface.parent = item_a;
+ clear->surface.parentx = PADDING;
+ clear->surface.parenty = frame->item_margin.top;
+ RrPaint(clear, self->icon,
+ ITEM_HEIGHT - frame->item_margin.top
+ - frame->item_margin.bottom,
+ ITEM_HEIGHT - frame->item_margin.top
+ - frame->item_margin.bottom);