From kde-commits Fri Jan 11 18:17:50 2008 From: =?utf-8?q?Aaron=20J=2E=20Seigo?= Date: Fri, 11 Jan 2008 18:17:50 +0000 To: kde-commits Subject: KDE/kdebase/workspace/libs/plasma/widgets Message-Id: <1200075470.589435.19461.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=120007547907510 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