[PATCH] Using KIcon for icons with overlay

Gustavo Pichorim Boiko gustavo.boiko at kdemail.net
Thu Aug 30 14:11:30 BST 2007

A Thursday 30 August 2007 00:38:53, Aaron J. Seigo escreveu:
> On Wednesday 29 August 2007, Gustavo Pichorim Boiko wrote:
> > A Wednesday 29 August 2007 14:30:48, Aaron J. Seigo escreveu:
> > > looking at the code, it seems this ought to go, at least in part, into
> > > KIconEffect. in fact, with a quick glance all KIconEffect is missing is
> > > a setEffect(int group, int state, KIconEffect::Effects effect, float
> > > value, const QColor &color) method.
> >
> > I would like it to be like a "preprocessing" effect (or a postprocessing
> > one as my implementation would say), that is applied before the effects
> > for the states are applied, I don't know if this would be possible by
> > this interface.
> one could add another effect set to KIconEffect which does what you
> want/need here. "Custom", so to speak. then apply this to every icon if
> set; though this leaves the overlay issue. we could abuse State here though
> by adding a value that causes the Custom effect to be applied to an icon.
> when drawOverlays calls loadIcon it would do so with (state ^
> CustomEfffect) (or

That would do the job probably.
I'm going to try this approach and see if it works

> whatever it is called). this would address this problem:
> > > then kopete could do sth like:
> > >
> > > iconLoader->iconEffect()->setEffect(..)
> >
> > If the idea is not to have an extra KIconLoader, I don't like this
> > approach, as it is easier for applications to make errors (one can forget
> .. since you'd have to specify that you wanted the custom effect
> (pre-)applied.


Thanks for your comments.

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

More information about the kde-core-devel mailing list