- Don't connect to the finished() signal in the fadeOut animation more

than once.
- Stop the animation going in the opposite direction before starting
  a fade out/fade in animation.

svn path=/trunk/KDE/kdebase/apps/; revision=1084788
This commit is contained in:
Fredrik Höglund 2010-02-03 19:14:20 +00:00
parent 80dcf48cae
commit 0ad36d8510

View file

@ -150,6 +150,7 @@ ActionOverlay::ActionOverlay(AbstractItemView* parent)
fadeOut->setProperty("startOpacity", 1);
fadeOut->setProperty("targetOpacity", 0);
fadeOut->setTargetWidget(this);
connect(fadeOut, SIGNAL(finished()), SLOT(close()));
hide();
}
@ -185,6 +186,7 @@ void ActionOverlay::entered(const QModelIndex &index)
show();
if (m_hoverIndex != index) {
m_iconToggleSelection->update();
fadeOut->stop();
fadeIn->start();
}
m_hoverIndex = index;
@ -206,8 +208,8 @@ void ActionOverlay::timeout()
m_hoverIndex = QPersistentModelIndex();
if (isVisible() && (fadeOut->state() != QAbstractAnimation::Running)) {
fadeIn->stop();
fadeOut->start();
connect(fadeOut, SIGNAL(finished()), SLOT(close()));
}
}