Skip to content
Merged
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
8 changes: 4 additions & 4 deletions metadata/extra-animations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@
</group>
<group>
<_short>Magic Carpet Settings</_short>
<option name="carpet_duration" type="animation">
<_short>Magic carpet duration</_short>
<option name="carpet_roll_duration" type="animation">
<_short>Roll Duration</_short>
<_long>Sets the duration for the magic carpet animation in milliseconds.</_long>
<default>1000ms linear</default>
</option>
<option name="carpet_direction" type="int">
<_short>Carpet Direction</_short>
<option name="carpet_roll_direction" type="int">
<_short>Roll Direction</_short>
<_long>From which side to unroll the carpet for the open animation. The opposite direction will be used on close animation.</_long>
<default>0</default>
<desc>
Expand Down
4 changes: 2 additions & 2 deletions src/extra-animations/carpet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ using namespace wf::animation;

static std::string carpet_transformer_name = "animation-carpet";

wf::option_wrapper_t<int> carpet_direction{"extra-animations/carpet_direction"};
wf::option_wrapper_t<int> carpet_roll_direction{"extra-animations/carpet_roll_direction"};

class carpet_transformer : public wf::scene::view_2d_transformer_t
{
Expand Down Expand Up @@ -282,7 +282,7 @@ class carpet_transformer : public wf::scene::view_2d_transformer_t
self->program.attrib_pointer("position", 2, 0, vertices);
self->program.attrib_pointer("uv_in", 2, 0, uv);
self->program.uniform1f("progress", progress);
self->program.uniform1i("direction", carpet_direction);
self->program.uniform1i("direction", carpet_roll_direction);

self->program.set_active_texture(tex);
GL_CALL(glDrawArrays(GL_TRIANGLE_FAN, 0, 4));
Expand Down
5 changes: 3 additions & 2 deletions src/extra-animations/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class wayfire_extra_animations : public wf::plugin_interface_t
wf::option_wrapper_t<wf::animation_description_t> vortex_duration{"extra-animations/vortex_duration"};
wf::option_wrapper_t<wf::animation_description_t> melt_duration{"extra-animations/melt_duration"};
wf::option_wrapper_t<wf::animation_description_t> burn_duration{"extra-animations/burn_duration"};
wf::option_wrapper_t<wf::animation_description_t> carpet_duration{"extra-animations/carpet_duration"};
wf::option_wrapper_t<wf::animation_description_t> carpet_roll_duration{
"extra-animations/carpet_roll_duration"};
std::unique_ptr<wf::dodge::wayfire_dodge> dodge_plugin;

public:
Expand Down Expand Up @@ -84,7 +85,7 @@ class wayfire_extra_animations : public wf::plugin_interface_t
});
effects_registry->register_effect("carpet", wf::animate::effect_description_t{
.generator = [] { return std::make_unique<wf::carpet::carpet_animation>(); },
.default_duration = [=] { return carpet_duration.value(); },
.default_duration = [=] { return carpet_roll_duration.value(); },
});
dodge_toggle.set_callback([=] {dodge_option_changed();});
dodge_option_changed();
Expand Down