one more API shift
svn path=/trunk/KDE/kdelibs/; revision=1038236
This commit is contained in:
parent
8b9830dc2b
commit
353c7d9aca
@ -37,12 +37,12 @@ AbstractAnimation::~AbstractAnimation()
|
||||
delete d;
|
||||
}
|
||||
|
||||
void AbstractAnimation::setAnimatedWidget(QGraphicsWidget* receiver)
|
||||
void AbstractAnimation::setWidgetToAnimate(QGraphicsWidget* receiver)
|
||||
{
|
||||
d->animObject = receiver;
|
||||
}
|
||||
|
||||
QGraphicsWidget* AbstractAnimation::animatedWidget()
|
||||
QGraphicsWidget* AbstractAnimation::widgetToAnimate()
|
||||
{
|
||||
return d->animObject.data();
|
||||
}
|
||||
|
@ -40,11 +40,11 @@ namespace Plasma
|
||||
class AbstractAnimationPrivate;
|
||||
|
||||
/**
|
||||
* Abstract base class for AnimationGroup and Animation.
|
||||
* @brief Abstract base class for AnimationGroup and Animation.
|
||||
* @since 4.4
|
||||
*/
|
||||
class PLASMA_EXPORT AbstractAnimation : public QObject
|
||||
{
|
||||
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QEasingCurve::Type easingCurveType READ easingCurveType WRITE setEasingCurveType)
|
||||
Q_PROPERTY(AnimationDirection direction READ direction WRITE setDirection)
|
||||
@ -60,7 +60,12 @@ public:
|
||||
* Set the widget on which the animation is to be performed.
|
||||
* @arg receiver The QGraphicsWidget to be animated.
|
||||
*/
|
||||
virtual void setAnimatedWidget(QGraphicsWidget* receiver);
|
||||
virtual void setWidgetToAnimate(QGraphicsWidget* receiver);
|
||||
|
||||
/**
|
||||
* The widget that the animation will be performed upon
|
||||
*/
|
||||
QGraphicsWidget *widgetToAnimate();
|
||||
|
||||
/**
|
||||
* Take an AbstractAnimation and turn it into a
|
||||
@ -119,7 +124,6 @@ public slots:
|
||||
virtual void start() = 0;
|
||||
|
||||
protected:
|
||||
QGraphicsWidget *animatedWidget();
|
||||
|
||||
private:
|
||||
AbstractAnimationPrivate *d;
|
||||
|
@ -75,7 +75,7 @@ void Animation::start()
|
||||
QAbstractAnimation* Animation::toQAbstractAnimation(QObject* parent)
|
||||
{
|
||||
//check if .setObject() was done
|
||||
if (!animatedWidget()) {
|
||||
if (!widgetToAnimate()) {
|
||||
kDebug() << "Object not set.";
|
||||
return NULL;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ ExpandAnimation::ExpandAnimation(AnimationDirection direction, qreal distance)
|
||||
QAbstractAnimation* ExpandAnimation::render(QObject* parent){
|
||||
|
||||
//get current geometry values
|
||||
QGraphicsWidget *m_object = animatedWidget();
|
||||
QGraphicsWidget *m_object = widgetToAnimate();
|
||||
QRectF geometry = m_object->geometry();
|
||||
|
||||
//compute new geometry values
|
||||
|
@ -33,7 +33,7 @@ FadeAnimation::FadeAnimation(qreal factor)
|
||||
QAbstractAnimation* FadeAnimation::render(QObject* parent){
|
||||
|
||||
//create animation
|
||||
QGraphicsWidget *m_object = animatedWidget();
|
||||
QGraphicsWidget *m_object = widgetToAnimate();
|
||||
QPropertyAnimation* anim = new QPropertyAnimation(m_object, "opacity", parent);
|
||||
anim->setEndValue(m_animFactor);
|
||||
anim->setDuration(duration());
|
||||
|
@ -33,7 +33,7 @@ GrowAnimation::GrowAnimation(qreal factor)
|
||||
QAbstractAnimation* GrowAnimation::render(QObject* parent){
|
||||
|
||||
//get current geometry values
|
||||
QGraphicsWidget *m_object = animatedWidget();
|
||||
QGraphicsWidget *m_object = widgetToAnimate();
|
||||
QRectF geometry = m_object->geometry();
|
||||
qreal w = geometry.width();
|
||||
qreal h = geometry.height();
|
||||
|
@ -68,7 +68,7 @@ PulseAnimation::~PulseAnimation()
|
||||
|
||||
void PulseAnimation::setCopy(QGraphicsWidget *copy)
|
||||
{
|
||||
QGraphicsWidget *target = animatedWidget();
|
||||
QGraphicsWidget *target = widgetToAnimate();
|
||||
d->under = copy;
|
||||
if (d->under != target) {
|
||||
d->under->setParentItem(target);
|
||||
@ -116,7 +116,7 @@ void PulseAnimation::resetPulser()
|
||||
|
||||
void PulseAnimation::createAnimation(qreal duration, qreal scale)
|
||||
{
|
||||
QGraphicsWidget *target = animatedWidget();
|
||||
QGraphicsWidget *target = widgetToAnimate();
|
||||
/* Fallback to parent widget if we don't have one 'shadow' widget */
|
||||
if (!d->under) {
|
||||
setCopy(target);
|
||||
|
@ -91,7 +91,7 @@ void RotationAnimation::setAngle(const qreal &angle)
|
||||
QPropertyAnimation *RotationAnimation::render(QObject *parent)
|
||||
{
|
||||
Q_UNUSED(parent);
|
||||
QGraphicsWidget *m_object = animatedWidget();
|
||||
QGraphicsWidget *m_object = widgetToAnimate();
|
||||
|
||||
QVector3D vector(0, 0, 0);
|
||||
|
||||
|
@ -34,7 +34,7 @@ SlideAnimation::SlideAnimation(AnimationDirection direction, qreal distance)
|
||||
|
||||
QAbstractAnimation* SlideAnimation::render(QObject* parent)
|
||||
{
|
||||
QGraphicsWidget *m_object = animatedWidget();
|
||||
QGraphicsWidget *m_object = widgetToAnimate();
|
||||
qreal x = m_object->x();
|
||||
qreal y = m_object->y();
|
||||
|
||||
|
@ -40,9 +40,9 @@ FocusIndicator::FocusIndicator(QGraphicsWidget *parent)
|
||||
m_background->setCacheAllRenderedFrames(true);
|
||||
|
||||
m_fadeIn = new FadeAnimation(1.0);
|
||||
m_fadeIn->setAnimatedWidget(this);
|
||||
m_fadeIn->setWidgetToAnimate(this);
|
||||
m_fadeOut = new FadeAnimation(0.0);
|
||||
m_fadeOut->setAnimatedWidget(this);
|
||||
m_fadeOut->setWidgetToAnimate(this);
|
||||
setOpacity(0);
|
||||
|
||||
parent->installEventFilter(this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user