diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-02-28 15:00:34 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-02-28 15:00:40 +0000 |
| commit | 4bc669f9331bb66ab30bd705d09f1239bc3e83ed (patch) | |
| tree | 0ffdfa24b039b601080c6a49699a8d73b779ed8a /src/managers/AnimationManager.cpp | |
| parent | f4f3aa2e505ca1b22688fb4a32f31c4bfb851dd0 (diff) | |
layers: add fully featured animations
Adds configs and layerrules to handle them
alas fixes #981
I have cooked
Diffstat (limited to 'src/managers/AnimationManager.cpp')
| -rw-r--r-- | src/managers/AnimationManager.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index 23584827..859e3b03 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -101,7 +101,7 @@ void CAnimationManager::tick() { g_pHyprRenderer->damageWindow(w.get()); } } else if (PLAYER) { - WLRBOXPREV = PLAYER->geometry; + WLRBOXPREV = CBox{PLAYER->realPosition.vec(), PLAYER->realSize.vec()}; PMONITOR = g_pCompositor->getMonitorFromVector(Vector2D(PLAYER->geometry.x, PLAYER->geometry.y) + Vector2D(PLAYER->geometry.width, PLAYER->geometry.height) / 2.f); if (!PMONITOR) continue; @@ -513,6 +513,27 @@ std::string CAnimationManager::styleValidInConfigVar(const std::string& config, if (style == "loop" || style == "once") return ""; return "unknown style"; + } else if (config.starts_with("layers")) { + if (style == "fade" || style == "" || style == "slide") + return ""; + else if (style.starts_with("popin")) { + // try parsing + float minPerc = 0.f; + if (style.find("%") != std::string::npos) { + try { + auto percstr = style.substr(style.find_last_of(' ')); + minPerc = std::stoi(percstr.substr(0, percstr.length() - 1)); + } catch (std::exception& e) { return "invalid minperc"; } + + return ""; + } + + minPerc; // fix warning + + return ""; + } + return ""; + return "unknown style"; } else { return "animation has no styles"; } |
