X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3.git;a=blobdiff_plain;f=mod_query%2Fwmessage.c;h=b8c5fa4bf24e400ab7f8b8e5ee6e32fa56640a7e;hp=aa6002da42518053a62dbe45794929bfee4e5873;hb=20070203;hpb=8366314611bf30a0f31d25bf5f5023186fa87692 diff --git a/mod_query/wmessage.c b/mod_query/wmessage.c index aa6002d..b8c5fa4 100644 --- a/mod_query/wmessage.c +++ b/mod_query/wmessage.c @@ -1,7 +1,7 @@ /* * ion/mod_query/wmessage.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * 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 @@ -16,6 +16,7 @@ #include #include #include +#include #include "wmessage.h" #include "inputp.h" @@ -77,9 +78,21 @@ static void wmsg_calc_size(WMessage *wmsg, WRectangle *geom) /*{{{ Draw */ +GR_DEFATTR(active); +GR_DEFATTR(inactive); + + +static void init_attr() +{ + GR_ALLOCATTR_BEGIN; + GR_ALLOCATTR(active); + GR_ALLOCATTR(inactive); + GR_ALLOCATTR_END; +} + + static void wmsg_draw(WMessage *wmsg, bool complete) { - const char *style=(REGION_IS_ACTIVE(wmsg) ? "active" : "inactive"); WRectangle geom; if(WMSG_BRUSH(wmsg)==NULL) @@ -90,8 +103,12 @@ static void wmsg_draw(WMessage *wmsg, bool complete) grbrush_begin(WMSG_BRUSH(wmsg), &geom, (complete ? 0 : GRBRUSH_NO_CLEAR_OK)); + grbrush_set_attr(WMSG_BRUSH(wmsg), REGION_IS_ACTIVE(wmsg) + ? GR_ATTR(active) + : GR_ATTR(inactive)); + draw_listing(WMSG_BRUSH(wmsg), &geom, &(wmsg->listing), - FALSE, style, style); + FALSE, GRATTR_NONE); grbrush_end(WMSG_BRUSH(wmsg)); } @@ -174,6 +191,8 @@ static bool wmsg_init(WMessage *wmsg, WWindow *par, const WFitParams *fp, p=p+l+1; } + init_attr(); + init_listing(&(wmsg->listing)); setup_listing(&(wmsg->listing), ptr, k, TRUE);