diff options
author | 2021-04-18 13:14:52 +0530 | |
---|---|---|
committer | 2021-04-18 13:14:52 +0530 | |
commit | a23b3c116285d3de1ff2f6ea8f9cdb97a118d962 (patch) | |
tree | d031ac590e5920dba6fc737c2c1d7735da4a6028 /src/lock.cpp | |
parent | d89d8215a6aa357731ca465c404b8b05a78b06c6 (diff) | |
download | whatsie-a23b3c116285d3de1ff2f6ea8f9cdb97a118d962.tar.gz whatsie-a23b3c116285d3de1ff2f6ea8f9cdb97a118d962.zip |
animate lock
Diffstat (limited to 'src/lock.cpp')
-rw-r--r-- | src/lock.cpp | 25 |
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() |