mirror of
https://github.com/hyprwm/hyprlock.git
synced 2025-01-27 12:59:48 +01:00
input-field: improve behavior of *lock colors (#596)
This commit is contained in:
parent
8a9f05fa1f
commit
83bda4883d
1 changed files with 8 additions and 8 deletions
|
@ -56,9 +56,9 @@ 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.outer : colorConfig.both;
|
colorConfig.both = colorConfig.both->m_bIsFallback ? colorConfig.fail : colorConfig.both;
|
||||||
colorConfig.caps = colorConfig.caps->m_bIsFallback ? colorConfig.outer : colorConfig.caps;
|
colorConfig.caps = colorConfig.caps->m_bIsFallback ? colorConfig.fail : colorConfig.caps;
|
||||||
colorConfig.num = colorConfig.num->m_bIsFallback ? colorConfig.outer : colorConfig.num;
|
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 +489,6 @@ void CPasswordInputField::updateColors() {
|
||||||
//
|
//
|
||||||
CGradientValueData* targetGrad = nullptr;
|
CGradientValueData* targetGrad = nullptr;
|
||||||
|
|
||||||
if (checkWaiting)
|
|
||||||
targetGrad = colorConfig.check;
|
|
||||||
else if (displayFail)
|
|
||||||
targetGrad = colorConfig.fail;
|
|
||||||
|
|
||||||
if (g_pHyprlock->m_bCapsLock && NUMLOCK)
|
if (g_pHyprlock->m_bCapsLock && NUMLOCK)
|
||||||
targetGrad = colorConfig.both;
|
targetGrad = colorConfig.both;
|
||||||
else if (g_pHyprlock->m_bCapsLock)
|
else if (g_pHyprlock->m_bCapsLock)
|
||||||
|
@ -501,6 +496,11 @@ void CPasswordInputField::updateColors() {
|
||||||
else if (NUMLOCK)
|
else if (NUMLOCK)
|
||||||
targetGrad = colorConfig.num;
|
targetGrad = colorConfig.num;
|
||||||
|
|
||||||
|
if (checkWaiting)
|
||||||
|
targetGrad = colorConfig.check;
|
||||||
|
else if (displayFail)
|
||||||
|
targetGrad = colorConfig.fail;
|
||||||
|
|
||||||
CGradientValueData* outerTarget = colorConfig.outer;
|
CGradientValueData* outerTarget = colorConfig.outer;
|
||||||
CColor innerTarget = colorConfig.inner;
|
CColor innerTarget = colorConfig.inner;
|
||||||
CColor fontTarget = (displayFail) ? colorConfig.fail->m_vColors.front() : colorConfig.font;
|
CColor fontTarget = (displayFail) ? colorConfig.fail->m_vColors.front() : colorConfig.font;
|
||||||
|
|
Loading…
Reference in a new issue