SVN commit 760002 by aseigo: give some shape to the icon M +9 -0 icon.cpp M +5 -0 icon.h --- trunk/KDE/kdebase/workspace/libs/plasma/widgets/icon.cpp #760001:760002 @@ -354,6 +354,15 @@ return d->drawBg; } +QPainterPath Icon::shape() const +{ + if (d->currentSize.width() < 1) { + return QGraphicsItem::shape(); + } + + return roundedRectangle(QRectF(QPointF(0.0, 0.0), d->currentSize).adjusted(-2, -2, 2, 2), 10.0); +} + QSizeF Icon::Private::displaySizeHint(const QStyleOptionGraphicsItem *option, const qreal width) const { if (text.isEmpty() && infoText.isEmpty()) { --- trunk/KDE/kdebase/workspace/libs/plasma/widgets/icon.h #760001:760002 @@ -191,6 +191,11 @@ */ bool drawBackground() const; + /** + * reimplemented from QGraphicsItem + */ + QPainterPath shape() const; + public Q_SLOTS: /** * Sets the appearance of the icon to pressed or restores the appearance