KIconLoader loadIcon and overlays/emblems API change
Aaron J. Seigo
aseigo at kde.org
Tue Jul 24 14:53:11 BST 2007
On Tuesday 24 July 2007, Zack Rusin wrote:
> On Monday 23 July 2007 09:08:09 pm Aaron J. Seigo wrote:
> The signature for icon methods is:
> QPixmap *Icon(const QString& name, int size=0,
> int state=K3Icon::DefaultState, const QStringList
> &overlays = QStringList());
> And then in the method loading the emblems you iterate over the string list
> and from what i see:
...
> if e.g. overlays[1] is an empty string than overlays[2] will be promoted to
> bottom right corner. So there's no way of specifying an emblem in for
> example, only, top left corner.
> How about we change const QStringList &overlays to const QMap<Qt::Corner,
> QString> &overlays?
few reasons i decided not to have explicit positioning:
- it's one less detail the user of the API needs to deal with
- we can easily extend this do more that one per corner should we desire
- couldn't think of a good use case where the emblem must be in the $CORNER of
the applet?
it seemed more future proof and easier to use if it simply automatically
arranged the emblems around the icon....
> The initialization of the corners in that case would be
> overlays[Qt::TopLeftCorner] = QLatin1String("love");
> (assuming we'll have "love" emblem)
how could we not? ;)
> and the order wouldn't have any
> special/magical meaning anymore.
--
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43
KDE core developer sponsored by Trolltech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070724/b4dcb0c6/attachment.sig>
More information about the kde-core-devel
mailing list