From f3aa1ede5c082999f44536704d7693c914279492 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 23 Jan 2008 08:28:02 +0100 Subject: [PATCH] textbox width is limited to unused space --- widgets/textbox.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/widgets/textbox.c b/widgets/textbox.c index c55c23d8..26368555 100644 --- a/widgets/textbox.c +++ b/widgets/textbox.c @@ -36,15 +36,15 @@ typedef struct } Data; static int -textbox_draw(Widget *widget, DrawCtx *ctx, int offset, - int used __attribute__ ((unused))) +textbox_draw(Widget *widget, DrawCtx *ctx, int offset, int used) { Data *d = widget->data; if(d->width) widget->area.width = d->width; 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;