[PATCH] Using KIcon for icons with overlay

Gustavo Pichorim Boiko gustavo.boiko at kdemail.net
Thu Aug 23 12:58:51 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,
> correct? so the overlay would be done using the regular presentation while
> the icon might be greyed out, colourized, etc ... essentially anything 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?

I've tried to do it in a not-much intrusive way.
This patch adds a setEffect() method to KIconLoader. If you want a custom 
effect to be applied to a set of icons, just create a KIconLoader and set its 
effect, and use this loader when loading icons.
Every time you change the effect, the cache of the iconloader is discarded, 
making sure the new effect is going to be applied to all requested icons.

Please review it and make suggestions/critics to this approach.

Thanks in advance
Gustavo Pichorim Boiko
KDE Developer      www.kde.org
Mandriva Labs      www.mandriva.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kiconloader_effect.patch
Type: text/x-diff
Size: 3728 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070823/01be3ab4/attachment.patch>

More information about the kde-core-devel mailing list