1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Enhanced animation

This commit is contained in:
nowrep 2011-03-03 13:38:41 +01:00
parent 29eb575322
commit 1eec94acda
2 changed files with 10 additions and 3 deletions

View File

@ -25,17 +25,23 @@ AutoFillWidget::AutoFillWidget(QUrl url, QByteArray data, QString pass, QWidget
connect(ui->never, SIGNAL(clicked()), this, SLOT(never())); connect(ui->never, SIGNAL(clicked()), this, SLOT(never()));
connect(ui->notnow, SIGNAL(clicked()), this, SLOT(hide())); connect(ui->notnow, SIGNAL(clicked()), this, SLOT(hide()));
connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(hide())); connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(hide()));
setMinimumHeight(1);
setMaximumHeight(1);
m_animation = new QTimeLine(300, this);
m_animation->setFrameRange(0, 35);
connect(m_animation, SIGNAL(frameChanged(int)),this, SLOT(frameChanged(int)));
QTimer::singleShot(300, m_animation, SLOT(start()));
} }
void AutoFillWidget::hide() void AutoFillWidget::hide()
{ {
m_animation = new QTimeLine(300, this);
m_animation->setFrameRange(0, 35);
m_animation->setDirection(QTimeLine::Backward); m_animation->setDirection(QTimeLine::Backward);
m_animation->stop();
m_animation->start(); m_animation->start();
connect(m_animation, SIGNAL(finished()), this, SLOT(close())); connect(m_animation, SIGNAL(finished()), this, SLOT(close()));
connect(m_animation, SIGNAL(frameChanged(int)),this, SLOT(frameChanged(int)));
} }
void AutoFillWidget::frameChanged(int frame) void AutoFillWidget::frameChanged(int frame)

View File

@ -4,6 +4,7 @@
#include <QWidget> #include <QWidget>
#include <QUrl> #include <QUrl>
#include <QTimeLine> #include <QTimeLine>
#include <QTimer>
namespace Ui { namespace Ui {
class AutoFillWidget; class AutoFillWidget;