give some shape to the icon
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=760002
This commit is contained in:
parent
0cac630a79
commit
3d6c1c5527
@ -354,6 +354,15 @@ bool Icon::drawBackground() const
|
|||||||
return d->drawBg;
|
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
|
QSizeF Icon::Private::displaySizeHint(const QStyleOptionGraphicsItem *option, const qreal width) const
|
||||||
{
|
{
|
||||||
if (text.isEmpty() && infoText.isEmpty()) {
|
if (text.isEmpty() && infoText.isEmpty()) {
|
||||||
|
@ -191,6 +191,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool drawBackground() const;
|
bool drawBackground() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* reimplemented from QGraphicsItem
|
||||||
|
*/
|
||||||
|
QPainterPath shape() const;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
/**
|
/**
|
||||||
* Sets the appearance of the icon to pressed or restores the appearance
|
* Sets the appearance of the icon to pressed or restores the appearance
|
||||||
|
Loading…
Reference in New Issue
Block a user