widgets: handle image size in text data
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
0012b8dfc0
commit
37e8b95ad9
|
@ -206,7 +206,10 @@ 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 (data->show_empty || tag->selected || tag_isoccupied(tag))
|
||||
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;
|
||||
|
||||
area_array_append(&tda->areas, area);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue