mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-09 23:25:57 +01:00
layers: separate anim configs for open/close (#5421)
This commit is contained in:
parent
846162cce1
commit
9b8ef9206d
2 changed files with 21 additions and 3 deletions
|
@ -646,6 +646,10 @@ void CConfigManager::setDefaultAnimationVars() {
|
||||||
INITANIMCFG("windowsOut");
|
INITANIMCFG("windowsOut");
|
||||||
INITANIMCFG("windowsMove");
|
INITANIMCFG("windowsMove");
|
||||||
|
|
||||||
|
// layers
|
||||||
|
INITANIMCFG("layersIn");
|
||||||
|
INITANIMCFG("layersOut");
|
||||||
|
|
||||||
// fade
|
// fade
|
||||||
INITANIMCFG("fadeIn");
|
INITANIMCFG("fadeIn");
|
||||||
INITANIMCFG("fadeOut");
|
INITANIMCFG("fadeOut");
|
||||||
|
@ -669,6 +673,9 @@ void CConfigManager::setDefaultAnimationVars() {
|
||||||
CREATEANIMCFG("borderangle", "global");
|
CREATEANIMCFG("borderangle", "global");
|
||||||
CREATEANIMCFG("workspaces", "global");
|
CREATEANIMCFG("workspaces", "global");
|
||||||
|
|
||||||
|
CREATEANIMCFG("layersIn", "layers");
|
||||||
|
CREATEANIMCFG("layersOut", "layers");
|
||||||
|
|
||||||
CREATEANIMCFG("windowsIn", "windows");
|
CREATEANIMCFG("windowsIn", "windows");
|
||||||
CREATEANIMCFG("windowsOut", "windows");
|
CREATEANIMCFG("windowsOut", "windows");
|
||||||
CREATEANIMCFG("windowsMove", "windows");
|
CREATEANIMCFG("windowsMove", "windows");
|
||||||
|
@ -679,6 +686,8 @@ void CConfigManager::setDefaultAnimationVars() {
|
||||||
CREATEANIMCFG("fadeShadow", "fade");
|
CREATEANIMCFG("fadeShadow", "fade");
|
||||||
CREATEANIMCFG("fadeDim", "fade");
|
CREATEANIMCFG("fadeDim", "fade");
|
||||||
CREATEANIMCFG("fadeLayers", "fade");
|
CREATEANIMCFG("fadeLayers", "fade");
|
||||||
|
CREATEANIMCFG("fadeLayersIn", "fadeLayers");
|
||||||
|
CREATEANIMCFG("fadeLayersOut", "fadeLayers");
|
||||||
|
|
||||||
CREATEANIMCFG("specialWorkspace", "workspaces");
|
CREATEANIMCFG("specialWorkspace", "workspaces");
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
#include "../Compositor.hpp"
|
#include "../Compositor.hpp"
|
||||||
|
|
||||||
SLayerSurface::SLayerSurface() {
|
SLayerSurface::SLayerSurface() {
|
||||||
alpha.create(g_pConfigManager->getAnimationPropertyConfig("fadeLayers"), this, AVARDAMAGE_ENTIRE);
|
alpha.create(g_pConfigManager->getAnimationPropertyConfig("fadeLayersIn"), this, AVARDAMAGE_ENTIRE);
|
||||||
realPosition.create(g_pConfigManager->getAnimationPropertyConfig("layers"), this, AVARDAMAGE_ENTIRE);
|
realPosition.create(g_pConfigManager->getAnimationPropertyConfig("layersIn"), this, AVARDAMAGE_ENTIRE);
|
||||||
realSize.create(g_pConfigManager->getAnimationPropertyConfig("layers"), this, AVARDAMAGE_ENTIRE);
|
realSize.create(g_pConfigManager->getAnimationPropertyConfig("layersIn"), this, AVARDAMAGE_ENTIRE);
|
||||||
alpha.registerVar();
|
alpha.registerVar();
|
||||||
realPosition.registerVar();
|
realPosition.registerVar();
|
||||||
realSize.registerVar();
|
realSize.registerVar();
|
||||||
|
@ -61,6 +61,15 @@ void SLayerSurface::applyRules() {
|
||||||
|
|
||||||
void SLayerSurface::startAnimation(bool in, bool instant) {
|
void SLayerSurface::startAnimation(bool in, bool instant) {
|
||||||
const auto ANIMSTYLE = animationStyle.value_or(realPosition.m_pConfig->pValues->internalStyle);
|
const auto ANIMSTYLE = animationStyle.value_or(realPosition.m_pConfig->pValues->internalStyle);
|
||||||
|
if (in) {
|
||||||
|
realPosition.m_pConfig = g_pConfigManager->getAnimationPropertyConfig("layersIn");
|
||||||
|
realSize.m_pConfig = g_pConfigManager->getAnimationPropertyConfig("layersIn");
|
||||||
|
alpha.m_pConfig = g_pConfigManager->getAnimationPropertyConfig("fadeLayersIn");
|
||||||
|
} else {
|
||||||
|
realPosition.m_pConfig = g_pConfigManager->getAnimationPropertyConfig("layersOut");
|
||||||
|
realSize.m_pConfig = g_pConfigManager->getAnimationPropertyConfig("layersOut");
|
||||||
|
alpha.m_pConfig = g_pConfigManager->getAnimationPropertyConfig("fadeLayersOut");
|
||||||
|
}
|
||||||
|
|
||||||
if (ANIMSTYLE.starts_with("slide")) {
|
if (ANIMSTYLE.starts_with("slide")) {
|
||||||
// get closest edge
|
// get closest edge
|
||||||
|
|
Loading…
Reference in a new issue