Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

animate: Add helix animation #2417

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
25 changes: 25 additions & 0 deletions metadata/animate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
<value>spin</value>
<_name>Spin</_name>
</desc>
<desc>
<value>helix</value>
<_name>Helix</_name>
</desc>
</option>
<option name="close_animation" type="string">
<_short>Close animation</_short>
Expand Down Expand Up @@ -62,6 +66,10 @@
<value>spin</value>
<_name>Spin</_name>
</desc>
<desc>
<value>helix</value>
<_name>Helix</_name>
</desc>
</option>
<option name="minimize_animation" type="string">
<_short>Minimze animation</_short>
Expand Down Expand Up @@ -169,5 +177,22 @@
<_long>Number of rotations for the spin animation. Negative values reverse the spin direction.</_long>
<default>1</default>
</option>
<option name="helix_duration" type="animation">
<_short>Helix duration</_short>
<_long>Sets the duration for the helix animation in milliseconds.</_long>
<default>250ms linear</default>
</option>
<option name="helix_rotations" type="int">
<_short>Helix rotations</_short>
<_long>Number of rotations for the helix animation.</_long>
<default>1</default>
<min>1</min>
</option>
<option name="helix_strip_height" type="int">
<_short>Helix strip height</_short>
<_long>Height of each helix strip in pixels.</_long>
<default>20</default>
<min>10</min>
</option>
</plugin>
</wayfire>
9 changes: 9 additions & 0 deletions plugins/animate/animate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "squeezimize.hpp"
#include "zap.hpp"
#include "spin.hpp"
#include "helix.hpp"
#include "fire/fire.hpp"
#include "unmapped-view-node.hpp"
#include "wayfire/plugin.hpp"
Expand Down Expand Up @@ -428,6 +429,10 @@ class wayfire_animation : public wf::plugin_interface_t, private wf::per_output_
{
set_animation<wf::spin::spin_animation>(ev->view, ANIMATION_TYPE_MAP,
animation.duration, animation.animation_name);
} else if (animation.animation_name == "helix")
{
set_animation<wf::helix::helix_animation>(ev->view, ANIMATION_TYPE_MAP,
animation.duration, animation.animation_name);
}
};

Expand Down Expand Up @@ -456,6 +461,10 @@ class wayfire_animation : public wf::plugin_interface_t, private wf::per_output_
{
set_animation<wf::spin::spin_animation>(ev->view, ANIMATION_TYPE_UNMAP,
animation.duration, animation.animation_name);
} else if (animation.animation_name == "helix")
{
set_animation<wf::helix::helix_animation>(ev->view, ANIMATION_TYPE_UNMAP,
animation.duration, animation.animation_name);
}
};

Expand Down
Loading
Loading