2009-10-22 05:59:27 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2009 Aaron Seigo <aseigo@kde.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Library General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this program; if not, write to the
|
|
|
|
* Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
2009-10-22 21:46:16 +02:00
|
|
|
#include "pause_p.h"
|
2009-10-22 05:59:27 +02:00
|
|
|
|
|
|
|
#include <QPauseAnimation>
|
|
|
|
|
|
|
|
namespace Plasma
|
|
|
|
{
|
|
|
|
|
|
|
|
PauseAnimation::PauseAnimation(QObject *parent)
|
|
|
|
: Animation(parent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-12-03 20:30:02 +01:00
|
|
|
void PauseAnimation::setWidgetToAnimate(QGraphicsWidget *widget)
|
|
|
|
{
|
|
|
|
Animation::setWidgetToAnimate(widget);
|
|
|
|
if (animation.data()) {
|
|
|
|
delete animation.data();
|
|
|
|
animation.clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-10-22 05:59:27 +02:00
|
|
|
QAbstractAnimation* PauseAnimation::render(QObject* parent)
|
|
|
|
{
|
2009-10-23 20:39:57 +02:00
|
|
|
//Recreate only if needed
|
2009-12-03 20:30:02 +01:00
|
|
|
QPauseAnimation *anim = animation.data();
|
2009-10-23 20:39:57 +02:00
|
|
|
if (!anim) {
|
2009-10-27 15:22:21 +01:00
|
|
|
anim = new QPauseAnimation(duration(), parent);
|
2009-12-03 20:30:02 +01:00
|
|
|
animation = anim;
|
2009-10-23 20:39:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return anim;
|
2009-10-22 05:59:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
} //namespace Plasma
|
|
|
|
|