From 1bfe32e7fa82a0b4a1a866ef13e7884bc17af498 Mon Sep 17 00:00:00 2001 From: Maximilian Seidler <78690852+PaideiaDilemma@users.noreply.github.com> Date: Tue, 9 Apr 2024 12:14:25 +0200 Subject: [PATCH] input-field: also fade in when checkWaiting is true (#265) --- src/renderer/widgets/PasswordInputField.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/renderer/widgets/PasswordInputField.cpp b/src/renderer/widgets/PasswordInputField.cpp index d15ba95..202bc8e 100644 --- a/src/renderer/widgets/PasswordInputField.cpp +++ b/src/renderer/widgets/PasswordInputField.cpp @@ -94,15 +94,17 @@ void CPasswordInputField::updateFade() { return; } - if (passwordLength > 0 && fade.allowFadeOut) + const bool INPUTUSED = passwordLength > 0 || checkWaiting; + + if (INPUTUSED && fade.allowFadeOut) fade.allowFadeOut = false; - if (passwordLength > 0 && fade.fadeOutTimer.get()) { + if (INPUTUSED && fade.fadeOutTimer.get()) { fade.fadeOutTimer->cancel(); fade.fadeOutTimer.reset(); } - if (passwordLength == 0 && fade.a != 0.0 && (!fade.animated || fade.appearing)) { + if (!INPUTUSED && fade.a != 0.0 && (!fade.animated || fade.appearing)) { if (fade.allowFadeOut || fadeTimeoutMs == 0) { fade.a = 1.0; fade.animated = true; @@ -113,7 +115,7 @@ void CPasswordInputField::updateFade() { fade.fadeOutTimer = g_pHyprlock->addTimer(std::chrono::milliseconds(fadeTimeoutMs), fadeOutCallback, this); } - if (passwordLength > 0 && fade.a != 1.0 && (!fade.animated || !fade.appearing)) { + if (INPUTUSED && fade.a != 1.0 && (!fade.animated || !fade.appearing)) { fade.a = 0.0; fade.animated = true; fade.appearing = true;