X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ioncore%2Finfowin.c;h=791cae0880da701a2b04ebf7a87a89ee6abba776;hb=be912256a10c9710090b9f67a7e0281847828640;hp=463b16e8a5eb277f1d6407e676eab85fd82fe14c;hpb=471a5e5f9928e2d324b2e10422a420f458bd63ff;p=ion3.git diff --git a/ioncore/infowin.c b/ioncore/infowin.c index 463b16e..791cae0 100644 --- a/ioncore/infowin.c +++ b/ioncore/infowin.c @@ -3,10 +3,7 @@ * * Copyright (c) Tuomo Valkonen 1999-2007. * - * Ion is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. + * See the included file LICENSE for details. */ #include @@ -19,6 +16,7 @@ #include "resize.h" #include "gr.h" #include "event.h" +#include "strings.h" /*{{{ Init/deinit */ @@ -53,8 +51,6 @@ bool infowin_init(WInfoWin *p, WWindow *parent, const WFitParams *fp, if(p->brush==NULL) goto fail3; - p->wwin.region.flags|=REGION_SKIP_FOCUS; - /* Enable save unders */ attr.save_under=True; XChangeWindowAttributes(ioncore_g.dpy, p->wwin.win, CWSaveUnder, &attr); @@ -198,9 +194,21 @@ static void infowin_resize(WInfoWin *p) * Set contents of the info window. */ EXTL_EXPORT_MEMBER -void infowin_set_text(WInfoWin *p, const char *str) +void infowin_set_text(WInfoWin *p, const char *str, int maxw) { - infowin_do_set_text(p, str); + bool set=FALSE; + + if(maxw>0 && p->brush!=NULL){ + char *tmp=grbrush_make_label(p->brush, str, maxw); + if(tmp!=NULL){ + infowin_do_set_text(p, tmp); + free(tmp); + set=TRUE; + } + } + + if(!set) + infowin_do_set_text(p, str); infowin_resize(p);