X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=mod_query%2Fwmessage.c;fp=mod_query%2Fwmessage.c;h=e7c5d3d70cda4ad81553dffd0ab103ca200c4b7a;hb=de22e45179cb3bafa490294d31d47f361047a30a;hp=b8c5fa4bf24e400ab7f8b8e5ee6e32fa56640a7e;hpb=803afbc1cd633f6c025bcd9537e9b7e9aedadd0d;p=ion3.git diff --git a/mod_query/wmessage.c b/mod_query/wmessage.c index b8c5fa4..e7c5d3d 100644 --- a/mod_query/wmessage.c +++ b/mod_query/wmessage.c @@ -11,12 +11,14 @@ #include -#include #include +#include #include #include #include #include +#include +#include #include "wmessage.h" #include "inputp.h" @@ -72,6 +74,22 @@ static void wmsg_calc_size(WMessage *wmsg, WRectangle *geom) } +void wmsg_size_hints(WMessage *wmsg, WSizeHints *hints_ret) +{ + int w=1, h=1; + + if(WMSG_BRUSH(wmsg)!=NULL){ + mod_query_get_minimum_extents(WMSG_BRUSH(wmsg), FALSE, &w, &h); + + w+=grbrush_get_text_width(WMSG_BRUSH(wmsg), "xxxxx", 5); + } + + hints_ret->min_set=TRUE; + hints_ret->min_width=w; + hints_ret->min_height=h; +} + + /*}}}*/ @@ -233,12 +251,12 @@ static const char *wmsg_style(WMessage *wmsg) static DynFunTab wmsg_dynfuntab[]={ - {window_draw, wmsg_draw}, - {input_calc_size, wmsg_calc_size}, - {input_scrollup, wmsg_scrollup}, - {input_scrolldown, wmsg_scrolldown}, - {(DynFun*)input_style, - (DynFun*)wmsg_style}, + {window_draw, wmsg_draw}, + {input_calc_size, wmsg_calc_size}, + {input_scrollup, wmsg_scrollup}, + {input_scrolldown, wmsg_scrolldown}, + {(DynFun*)input_style, (DynFun*)wmsg_style}, + {region_size_hints, wmsg_size_hints}, END_DYNFUNTAB };