From 1eec94acdadabd7ae2f2f3dbdc9e2595e66074a2 Mon Sep 17 00:00:00 2001 From: nowrep Date: Thu, 3 Mar 2011 13:38:41 +0100 Subject: [PATCH] Enhanced animation --- src/autofill/autofillwidget.cpp | 12 +++++++++--- src/autofill/autofillwidget.h | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/autofill/autofillwidget.cpp b/src/autofill/autofillwidget.cpp index 5e06f9f12..e243b959a 100644 --- a/src/autofill/autofillwidget.cpp +++ b/src/autofill/autofillwidget.cpp @@ -25,17 +25,23 @@ AutoFillWidget::AutoFillWidget(QUrl url, QByteArray data, QString pass, QWidget connect(ui->never, SIGNAL(clicked()), this, SLOT(never())); connect(ui->notnow, 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() { - m_animation = new QTimeLine(300, this); - m_animation->setFrameRange(0, 35); m_animation->setDirection(QTimeLine::Backward); + m_animation->stop(); m_animation->start(); connect(m_animation, SIGNAL(finished()), this, SLOT(close())); - connect(m_animation, SIGNAL(frameChanged(int)),this, SLOT(frameChanged(int))); } void AutoFillWidget::frameChanged(int frame) diff --git a/src/autofill/autofillwidget.h b/src/autofill/autofillwidget.h index 9cf3d0579..267341441 100644 --- a/src/autofill/autofillwidget.h +++ b/src/autofill/autofillwidget.h @@ -4,6 +4,7 @@ #include #include #include +#include namespace Ui { class AutoFillWidget;