Moved sideAngle to be a static const member
svn path=/trunk/KDE/kdelibs/; revision=1083081
This commit is contained in:
parent
cc2a593588
commit
6086b03de5
@ -24,11 +24,11 @@
|
|||||||
#include "stackedlayout.h"
|
#include "stackedlayout.h"
|
||||||
#include "plasma.h"
|
#include "plasma.h"
|
||||||
|
|
||||||
const int sideAngle = 90;
|
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
|
|
||||||
|
const int RotationStackedAnimation::s_sideAngle = 90;
|
||||||
|
|
||||||
RotationStackedAnimation::RotationStackedAnimation(QObject *parent)
|
RotationStackedAnimation::RotationStackedAnimation(QObject *parent)
|
||||||
: Animation(parent)
|
: Animation(parent)
|
||||||
{
|
{
|
||||||
@ -183,13 +183,13 @@ void RotationStackedAnimation::updateCurrentTime(int currentTime)
|
|||||||
if (currentTime <= duration()/2) {
|
if (currentTime <= duration()/2) {
|
||||||
layout->setCurrentWidgetIndex(0);
|
layout->setCurrentWidgetIndex(0);
|
||||||
delta = easingCurve().valueForProgress((currentTime*2) / qreal(duration()));
|
delta = easingCurve().valueForProgress((currentTime*2) / qreal(duration()));
|
||||||
delta *= sideAngle;
|
delta *= s_sideAngle;
|
||||||
m_frontRotation->setAngle(delta);
|
m_frontRotation->setAngle(delta);
|
||||||
} else {
|
} else {
|
||||||
layout->setCurrentWidgetIndex(1);
|
layout->setCurrentWidgetIndex(1);
|
||||||
delta = 1 - easingCurve().valueForProgress(((currentTime*2) - duration()) / qreal(duration()));
|
delta = 1 - easingCurve().valueForProgress(((currentTime*2) - duration()) / qreal(duration()));
|
||||||
delta = -delta;
|
delta = -delta;
|
||||||
delta *= sideAngle;
|
delta *= s_sideAngle;
|
||||||
m_backRotation->setAngle(delta);
|
m_backRotation->setAngle(delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,6 +118,8 @@ private:
|
|||||||
QGraphicsRotation *m_backRotation;
|
QGraphicsRotation *m_backRotation;
|
||||||
/** Front Widget Rotation transform object */
|
/** Front Widget Rotation transform object */
|
||||||
QGraphicsRotation *m_frontRotation;
|
QGraphicsRotation *m_frontRotation;
|
||||||
|
|
||||||
|
static const int s_sideAngle;
|
||||||
};
|
};
|
||||||
} // Plasma
|
} // Plasma
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user