diff --git a/widgets/itembackground.cpp b/widgets/itembackground.cpp index 646e24969..1623b6f4c 100644 --- a/widgets/itembackground.cpp +++ b/widgets/itembackground.cpp @@ -106,6 +106,10 @@ QVariant ItemBackground::itemChange(GraphicsItemChange change, const QVariant &v { if (change == ItemVisibleChange) { bool visible = value.toBool(); + bool retVisible = visible; + if (visible == isVisible() || d->animId == 0) { + retVisible = true; + } d->fading = true; d->fadeIn = visible; @@ -115,7 +119,9 @@ QVariant ItemBackground::itemChange(GraphicsItemChange change, const QVariant &v d->animId = Plasma::Animator::self()->customAnimation( 10, 250, Plasma::Animator::EaseInCurve, this, "animationUpdate"); + return retVisible; } + return value; } void ItemBackground::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) diff --git a/widgets/itembackground.h b/widgets/itembackground.h index 6f1a67962..2b311a2b7 100644 --- a/widgets/itembackground.h +++ b/widgets/itembackground.h @@ -23,9 +23,6 @@ #include -namespace Plasma { - class FrameSvg; -} /** * @class ItemBackground plasma/widgets/itembackground.h @@ -34,8 +31,9 @@ namespace Plasma { * * @since 4.4 */ -namespace Plasma -{ +namespace Plasma { + +class FrameSvg; class ItemBackgroundPrivate; class ItemBackground : public QGraphicsWidget