aboutsummaryrefslogtreecommitdiff
path: root/src/lock.cpp
diff options
context:
space:
mode:
authorLibravatar keshavbhatt <keshavnrj@gmail.com>2021-04-18 13:14:52 +0530
committerLibravatar keshavbhatt <keshavnrj@gmail.com>2021-04-18 13:14:52 +0530
commita23b3c116285d3de1ff2f6ea8f9cdb97a118d962 (patch)
treed031ac590e5920dba6fc737c2c1d7735da4a6028 /src/lock.cpp
parentd89d8215a6aa357731ca465c404b8b05a78b06c6 (diff)
downloadwhatsie-a23b3c116285d3de1ff2f6ea8f9cdb97a118d962.tar.gz
whatsie-a23b3c116285d3de1ff2f6ea8f9cdb97a118d962.zip
animate lock
Diffstat (limited to 'src/lock.cpp')
-rw-r--r--src/lock.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/lock.cpp b/src/lock.cpp
index f71f60b..00d5f99 100644
--- a/src/lock.cpp
+++ b/src/lock.cpp
@@ -20,16 +20,10 @@ Lock::Lock(QWidget *parent) :
ui->setPass->setEnabled(false);
ui->wrong->hide();
- ui->centerWidget->hide();
QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(this);
ui->centerWidget->setGraphicsEffect(eff);
- QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity");
- a->setDuration(400);
- a->setStartValue(0);
- a->setEndValue(1);
- a->setEasingCurve(QEasingCurve::InCurve);
- a->start(QPropertyAnimation::DeleteWhenStopped);
- ui->centerWidget->show();
+
+ animate();
if(settings.value("asdfg").isValid() == false)
{
@@ -55,6 +49,18 @@ Lock::Lock(QWidget *parent) :
}
+void Lock::animate()
+{
+ ui->centerWidget->hide();
+ QPropertyAnimation *a = new QPropertyAnimation(ui->centerWidget->graphicsEffect(),"opacity");
+ a->setDuration(400);
+ a->setStartValue(0);
+ a->setEndValue(1);
+ a->setEasingCurve(QEasingCurve::InCurve);
+ a->start(QPropertyAnimation::DeleteWhenStopped);
+ ui->centerWidget->show();
+}
+
void Lock::applyThemeQuirks(){
//little quirks
@@ -176,9 +182,10 @@ void Lock::lock_app()
ui->wrong->hide();
ui->signup->hide();
ui->login->show();
- ui->passcodeLogin->setFocus();
isLocked = true;
this->show();
+ animate();
+ ui->passcodeLogin->setFocus();
}
void Lock::on_passcodeLogin_returnPressed()