widgets: handle image size in text data

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-06-26 16:53:58 +02:00
parent 0012b8dfc0
commit 37e8b95ad9
2 changed files with 7 additions and 1 deletions

View File

@ -206,6 +206,9 @@ taglist_draw(draw_context_t *ctx, int screen, widget_node_t *w,
area = draw_text_extents(ctx->connection, ctx->phys_screen,
globalconf.font, text[i], &pdata[i]);
if(pdata[i].bg_image)
area.width = MAX(area.width, pdata[i].bg_resize ? w->area.height : pdata[i].bg_image->width);
if(data->show_empty || tag->selected || tag_isoccupied(tag))
w->area.width += area.width;

View File

@ -65,6 +65,9 @@ textbox_draw(draw_context_t *ctx, int screen __attribute__ ((unused)),
ctx->phys_screen,
globalconf.font, d->text, &pdata).width,
ctx->width - used);
if(pdata.bg_image)
w->area.width = MAX(w->area.width, pdata.bg_resize ? w->area.height : pdata.bg_image->width);
pdata_arg = &pdata;
}