appear and disappear animation for the message overlay

svn path=/trunk/KDE/kdelibs/; revision=921039
This commit is contained in:
Marco Martin 2009-02-04 11:39:22 +00:00
parent 96fdff9468
commit 9a905cd11b
2 changed files with 22 additions and 2 deletions

View File

@ -496,9 +496,10 @@ void AppletPrivate::destroyMessageOverlay()
{
//TODO: fade out? =)
QGraphicsWidget *w = messageOverlay;
messageOverlay->destroy();
messageOverlay = 0;
w->hide();
w->deleteLater();
MessageButton buttonCode = ButtonNo;
//find out if we're disappearing because of a button press
@ -2252,6 +2253,21 @@ AppletOverlayWidget::AppletOverlayWidget(QGraphicsWidget *parent)
: QGraphicsWidget(parent)
{
resize(parent->size());
Animator::self()->animateItem(this, Animator::AppearAnimation);
}
void AppletOverlayWidget::destroy()
{
connect(Animator::self(),
SIGNAL(animationFinished(QGraphicsItem*,Plasma::Animator::Animation)),
this,
SLOT(overlayAnimationCompleteComplete(QGraphicsItem*,Plasma::Animator::Animation)));
Animator::self()->animateItem(this, Animator::DisappearAnimation);
}
void AppletOverlayWidget::overlayAnimationComplete()
{
deleteLater();
}
void AppletOverlayWidget::paint(QPainter *painter,

View File

@ -38,9 +38,13 @@ class AppletOverlayWidget : public QGraphicsWidget
{
public:
AppletOverlayWidget(QGraphicsWidget *parent);
void destroy();
protected:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
protected Q_SLOTS:
void overlayAnimationComplete();
};
class AppletPrivate