Skip to content

Commit

Permalink
animations: linear bezier for gradient, warp behavior (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaideiaDilemma authored Feb 21, 2025
1 parent c4b2175 commit f6e4c13
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/config/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ void CConfigManager::init() {

// set config for root node
m_AnimationTree.setConfigForNode("global", 1, 8.f, "default");
m_AnimationTree.setConfigForNode("inputFieldColors", 1, 8.f, "linear");

m_config.commence();

Expand Down
8 changes: 4 additions & 4 deletions src/core/AnimationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
#include "../config/ConfigManager.hpp"

CHyprlockAnimationManager::CHyprlockAnimationManager() {
;
addBezierWithName("linear", {0, 0}, {1, 1});
}

template <Animable VarType>
void updateVariable(CAnimatedVariable<VarType>& av, const float POINTY, bool warp = false) {
if (warp || !av.enabled() || av.value() == av.goal()) {
av.warp();
av.warp(true, false);
return;
}

Expand All @@ -20,7 +20,7 @@ void updateVariable(CAnimatedVariable<VarType>& av, const float POINTY, bool war

void updateColorVariable(CAnimatedVariable<CHyprColor>& av, const float POINTY, bool warp = false) {
if (warp || !av.enabled() || av.value() == av.goal()) {
av.warp();
av.warp(true, false);
return;
}

Expand All @@ -44,7 +44,7 @@ void updateColorVariable(CAnimatedVariable<CHyprColor>& av, const float POINTY,

void updateGradientVariable(CAnimatedVariable<CGradientValueData>& av, const float POINTY, bool warp = false) {
if (warp || av.value() == av.goal()) {
av.warp();
av.warp(true, false);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/widgets/PasswordInputField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ void CPasswordInputField::updateColors() {
CHyprColor innerTarget = colorConfig.inner;
CHyprColor fontTarget = (displayFail) ? colorConfig.fail->m_vColors.front() : colorConfig.font;

if (checkWaiting || displayFail || g_pHyprlock->m_bCapsLock || (NUMLOCK && !colorConfig.num->m_bIsFallback)) {
if (targetGrad) {
if (BORDERLESS && colorConfig.swapFont) {
fontTarget = targetGrad->m_vColors.front();
} else if (BORDERLESS && !colorConfig.swapFont) {
Expand Down

0 comments on commit f6e4c13

Please sign in to comment.