From 44a834a08d38cda321eb53ba1c56317191f690c4 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Fri, 8 Jan 2010 23:13:20 +0000 Subject: Prevent status bar text overflow svn path=/trunk/netsurf/; revision=9797 --- amiga/gui.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'amiga') diff --git a/amiga/gui.c b/amiga/gui.c index 219d2aa11..cefed047a 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -3207,6 +3207,16 @@ void gui_window_set_status(struct gui_window *g, const char *text) if((g->shared->status == NULL) || (strcmp(utf8text,g->shared->status))) { + ULONG size; + UWORD chars; + struct TextExtent text; + + GetAttr(GA_Width, g->shared->gadgets[GID_STATUS],(ULONG *)&size); + chars = TextFit(&scrn->RastPort, utf8text, strlen(utf8text), + &text, NULL, 1, size - 2, scrn->RastPort.TxHeight); + + utf8text[chars] = 0; + SetGadgetAttrs(g->shared->gadgets[GID_STATUS], g->shared->win, NULL, GA_Text, utf8text, -- cgit v1.2.3