Speed up the toolbox animations a bit. Arbitrary values, but 250ms still looks

smooth here whereas 200ms (what I really wanted) doesn't. Nothing else appears
to use Phase::moveItem() at the moment so am changing it directly. The duration
change in ToolBox is so that the moveItem() animation and customAnimation match
up exactly.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=756456
This commit is contained in:
Jason Stubbs 2008-01-03 09:43:13 +00:00
parent 092b7ff835
commit b97d76a52e
2 changed files with 5 additions and 3 deletions

View File

@ -111,7 +111,9 @@ void DesktopToolbox::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
}
m_showing = true;
m_animId = phase->customAnimation(m_size, 150, Plasma::Phase::EaseInCurve, this, "animate");
// TODO: 10 and 200 shouldn't be hardcoded here. There needs to be a way to
// match whatever the time is that moveItem() takes. Same in hoverLeaveEvent().
m_animId = phase->customAnimation(10, 250, Plasma::Phase::EaseInCurve, this, "animate");
QGraphicsItem::hoverEnterEvent(event);
}
@ -135,7 +137,7 @@ void DesktopToolbox::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
}
m_showing = false;
m_animId = phase->customAnimation(m_size, 150, Plasma::Phase::EaseOutCurve, this, "animate");
m_animId = phase->customAnimation(10, 250, Plasma::Phase::EaseOutCurve, this, "animate");
QGraphicsItem::hoverLeaveEvent(event);
}

View File

@ -292,7 +292,7 @@ void Phase::moveItem(QGraphicsItem* item, Movement movement, const QPoint &desti
//TODO: variance in times based on the value of animation
state->frames = frames / 2;
state->currentFrame = 0;
state->interval = 400 / state->frames;
state->interval = 250 / state->frames;
state->interval = (state->interval / MIN_TICK_RATE) * MIN_TICK_RATE;
state->currentInterval = state->interval;