textbox width is limited to unused space
This commit is contained in:
parent
fa0ac03f5b
commit
f3aa1ede5c
|
@ -36,15 +36,15 @@ typedef struct
|
||||||
} Data;
|
} Data;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
textbox_draw(Widget *widget, DrawCtx *ctx, int offset,
|
textbox_draw(Widget *widget, DrawCtx *ctx, int offset, int used)
|
||||||
int used __attribute__ ((unused)))
|
|
||||||
{
|
{
|
||||||
Data *d = widget->data;
|
Data *d = widget->data;
|
||||||
|
|
||||||
if(d->width)
|
if(d->width)
|
||||||
widget->area.width = d->width;
|
widget->area.width = d->width;
|
||||||
else
|
else
|
||||||
widget->area.width = draw_textwidth(widget->font, d->text);
|
widget->area.width = MIN(draw_textwidth(widget->font, d->text),
|
||||||
|
widget->statusbar->width - used);
|
||||||
|
|
||||||
widget->area.height = widget->statusbar->height;
|
widget->area.height = widget->statusbar->height;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue