summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2010-01-08 23:13:20 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2010-01-08 23:13:20 +0000
commit44a834a08d38cda321eb53ba1c56317191f690c4 (patch)
tree6932c8a77ff4254b4711ce47e31909d587b5c6c7
parent7014a8d249795a4507ccf4deb4af621636f3541a (diff)
downloadnetsurf-44a834a08d38cda321eb53ba1c56317191f690c4.tar.gz
netsurf-44a834a08d38cda321eb53ba1c56317191f690c4.tar.bz2
Prevent status bar text overflow
svn path=/trunk/netsurf/; revision=9797
-rwxr-xr-xamiga/gui.c10
1 files changed, 10 insertions, 0 deletions
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,