Using KIcon for icons with overlay

Gustavo Pichorim Boiko gustavo.boiko at kdemail.net
Wed Aug 22 18:54:42 BST 2007


A Wednesday 22 August 2007 14:25:59, Aaron J. Seigo escreveu:
> On Wednesday 22 August 2007, Gustavo Pichorim Boiko wrote:
> > Is there a way to apply a custom effect to an icon (in this case applying
> > a color) before it gets the overlays drawn?
>
> so you want the overlay to not have the same effect as the overlay,

I guess you mean "the same effect as the icon", in this case, yes :)

> correct? so the overlay would be done using the regular presentation while
> the icon might be greyed out, colourized, etc ... essentially anything in
> KIconEffect?

Yes, if there was a way to set up an effect (or a set of effects maybe) that 
should be applied to the icon, that would be enough, since the effects needed 
for kopete are all present in KIconEffect.

> > If not, would it be possible to change KIcon to support this before 4.0?
>
> probably. do you have any specific API suggestions?

Not yet. I have just some vague ideas. One approach could be adding some 
effect flags in KIconLoader, so that when you need an icon to have some 
effects applied you create a dedicated KIconLoader for that icon (this way we 
only have to do changes in KIconLoader, but we have the disadvantage of 
having to create a new icon loader to apply the effects).

Other option could be to add the effect flag (and the argument to the effect 
when necessary) in KIcon and in KIconLoader: this implies changes in both 
classes, but we wouldn't need to create a dedicated KIconLoader for the icon.

For the kopete case, the first option would suffice, as I could create a 
dedicated KIconLoader just for the accounts that have custom colors (and 
those would be very few in fact).

I'll try to write some API suggestions to add support for that.

Cheers
-- 
Gustavo Pichorim Boiko
-----------------------------------
KDE Developer      www.kde.org
Mandriva Labs      www.mandriva.com




More information about the kde-core-devel mailing list