Hi Xavier,
> Here is a preliminary patch to add support of a 'visible' attribute for
> icons. In fact it's not very mush work. But this would need more things:
Looks good, but I'd prefer another way of doing this.
> - if !visible, it uses the first frame of the sequence. For my icons the
> first bitmap is empty, but it may not be the case of all icons. Maybe
> add and empty bitmap at the beginning of each sequence (and skip it for
> normal showing) ?
This is exactly the stuff I'd do another way.
> - a better solution would be to implement the visible attribute withing
> the layout itself so it can work for text and other widgets without
> implementing it for each one. But I can't figure out where to hack for
> this.
I'm afraid this is not possible.
Now for my idea: I would process the icon just like any other icon, but
replace its position in the framebuffer with a blank. This way, one does
not have to care about empty bitmaps; and it would be faster (you don't
need to redefine the bitmap if changing to invisible).
Taking a quick look at the code, this has to be done in the draw()
function inside drv_generic_text.c. There are some lines where
Icon->ascii is transferred to the framebuffer and/or the display. Add
some short code here to use a blank instead of the ascii value.
Another point: I would not issue a warning about a missing
visible_expression. If none is there (which should be the default),
don't replace it with "1", but hanlde this by not evaluating the
expression if NULL, but using 1 as a result.
The same should be applied to the text widget.
Maybe this could be combinded with a "blinking" attribute.
bye, Michael
--
Michael Reinelt Tel: +43 676 3079941
Geisslergasse 4 Fax: +43 316 692343
A-8045 Graz, Austria e-mail: re...@eu...
|