input-field: don't change outer color when numlock_color is not set (#621)

* input-field: don't change outer color when numlock_color is not set

* input-field: same for bothlock_color
This commit is contained in:
Maximilian Seidler 2024-12-29 18:38:16 +00:00 committed by GitHub
parent 753c538dea
commit 3d63d9b129
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -56,9 +56,7 @@ CPasswordInputField::CPasswordInputField(const Vector2D& viewport_, const std::u
dots.size = std::clamp(dots.size, 0.2f, 0.8f); dots.size = std::clamp(dots.size, 0.2f, 0.8f);
dots.spacing = std::clamp(dots.spacing, -1.f, 1.f); dots.spacing = std::clamp(dots.spacing, -1.f, 1.f);
colorConfig.transitionMs = std::clamp(colorConfig.transitionMs, 0, 1000); colorConfig.transitionMs = std::clamp(colorConfig.transitionMs, 0, 1000);
colorConfig.both = colorConfig.both->m_bIsFallback ? colorConfig.fail : colorConfig.both;
colorConfig.caps = colorConfig.caps->m_bIsFallback ? colorConfig.fail : colorConfig.caps; colorConfig.caps = colorConfig.caps->m_bIsFallback ? colorConfig.fail : colorConfig.caps;
colorConfig.num = colorConfig.num->m_bIsFallback ? colorConfig.fail : colorConfig.num;
colorState.inner = colorConfig.inner; colorState.inner = colorConfig.inner;
colorState.outer = *colorConfig.outer; colorState.outer = *colorConfig.outer;
@ -489,11 +487,11 @@ void CPasswordInputField::updateColors() {
// //
CGradientValueData* targetGrad = nullptr; CGradientValueData* targetGrad = nullptr;
if (g_pHyprlock->m_bCapsLock && NUMLOCK) if (g_pHyprlock->m_bCapsLock && NUMLOCK && !colorConfig.both->m_bIsFallback)
targetGrad = colorConfig.both; targetGrad = colorConfig.both;
else if (g_pHyprlock->m_bCapsLock) else if (g_pHyprlock->m_bCapsLock)
targetGrad = colorConfig.caps; targetGrad = colorConfig.caps;
else if (NUMLOCK) else if (NUMLOCK && !colorConfig.num->m_bIsFallback)
targetGrad = colorConfig.num; targetGrad = colorConfig.num;
if (checkWaiting) if (checkWaiting)