mirror of
https://github.com/hyprwm/Hyprland
synced 2025-01-10 14:29:47 +01:00
config: update animation even if disabled
This commit is contained in:
parent
830350a1f7
commit
c143907857
1 changed files with 21 additions and 23 deletions
|
@ -2053,37 +2053,35 @@ std::optional<std::string> CConfigManager::handleAnimation(const std::string& co
|
||||||
if (enabledInt != 0 && enabledInt != 1)
|
if (enabledInt != 0 && enabledInt != 1)
|
||||||
return "invalid animation on/off state";
|
return "invalid animation on/off state";
|
||||||
|
|
||||||
if (enabledInt) {
|
int64_t speed = -1;
|
||||||
int64_t speed = -1;
|
|
||||||
|
|
||||||
// speed
|
// speed
|
||||||
if (isNumber(ARGS[2], true)) {
|
if (isNumber(ARGS[2], true)) {
|
||||||
speed = std::stof(ARGS[2]);
|
speed = std::stof(ARGS[2]);
|
||||||
|
|
||||||
if (speed <= 0) {
|
if (speed <= 0) {
|
||||||
speed = 1.f;
|
speed = 1.f;
|
||||||
return "invalid speed";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
speed = 10.f;
|
|
||||||
return "invalid speed";
|
return "invalid speed";
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
speed = 10.f;
|
||||||
|
return "invalid speed";
|
||||||
|
}
|
||||||
|
|
||||||
std::string bezierName = ARGS[3];
|
std::string bezierName = ARGS[3];
|
||||||
m_AnimationTree.setConfigForNode(ANIMNAME, enabledInt, speed, ARGS[3], ARGS[4]);
|
m_AnimationTree.setConfigForNode(ANIMNAME, enabledInt, speed, ARGS[3], ARGS[4]);
|
||||||
|
|
||||||
if (!g_pAnimationManager->bezierExists(bezierName)) {
|
if (!g_pAnimationManager->bezierExists(bezierName)) {
|
||||||
const auto PANIMNODE = m_AnimationTree.getConfig(ANIMNAME);
|
const auto PANIMNODE = m_AnimationTree.getConfig(ANIMNAME);
|
||||||
PANIMNODE->internalBezier = "default";
|
PANIMNODE->internalBezier = "default";
|
||||||
return "no such bezier";
|
return "no such bezier";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ARGS[4] != "") {
|
if (ARGS[4] != "") {
|
||||||
auto ERR = g_pAnimationManager->styleValidInConfigVar(ANIMNAME, ARGS[4]);
|
auto ERR = g_pAnimationManager->styleValidInConfigVar(ANIMNAME, ARGS[4]);
|
||||||
|
|
||||||
if (ERR != "")
|
if (ERR != "")
|
||||||
return ERR;
|
return ERR;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
|
|
Loading…
Reference in a new issue