appear and disappear animation for the message overlay
svn path=/trunk/KDE/kdelibs/; revision=921039
This commit is contained in:
parent
96fdff9468
commit
9a905cd11b
20
applet.cpp
20
applet.cpp
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user