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 blinds animation #2418

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions metadata/animate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<value>fire</value>
<_name>Fire</_name>
</desc>
<desc>
<value>blinds</value>
<_name>Blinds</_name>
</desc>
</option>
<option name="close_animation" type="string">
<_short>Close animation</_short>
Expand All @@ -46,6 +50,10 @@
<value>fire</value>
<_name>Fire</_name>
</desc>
<desc>
<value>blinds</value>
<_name>Blinds</_name>
</desc>
</option>
<!-- Preferred animation -->
<option name="enabled_for" type="string">
Expand Down Expand Up @@ -116,5 +124,10 @@
<_long>Sets the color of the fire effects, alpha is ignored</_long>
<default>#b22303ff</default>
</option>
<option name="blinds_duration" type="animation">
<_short>Blinds duration</_short>
<_long>Sets the duration for the blinds animation in milliseconds.</_long>
<default>700ms linear</default>
</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 @@ -8,6 +8,7 @@
#include "animate.hpp"
#include "system_fade.hpp"
#include "basic_animations.hpp"
#include "blinds.hpp"
#include "fire/fire.hpp"
#include "unmapped-view-node.hpp"
#include "wayfire/plugin.hpp"
Expand Down Expand Up @@ -416,6 +417,10 @@ class wayfire_animation : public wf::plugin_interface_t, private wf::per_output_
{
set_animation<FireAnimation>(ev->view, ANIMATION_TYPE_MAP,
animation.duration, animation.animation_name);
} else if (animation.animation_name == "blinds")
{
set_animation<wf::blinds::blinds_animation>(ev->view, ANIMATION_TYPE_MAP,
animation.duration, animation.animation_name);
}
};

Expand All @@ -436,6 +441,10 @@ class wayfire_animation : public wf::plugin_interface_t, private wf::per_output_
{
set_animation<FireAnimation>(ev->view, ANIMATION_TYPE_UNMAP,
animation.duration, animation.animation_name);
} else if (animation.animation_name == "blinds")
{
set_animation<wf::blinds::blinds_animation>(ev->view, ANIMATION_TYPE_UNMAP,
animation.duration, animation.animation_name);
}
};

Expand Down
Loading
Loading