mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-28 16:29:34 +08:00
Animation (#355)
This commit is contained in:
@@ -12,6 +12,10 @@
|
||||
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
||||
#include "ftxui/dom/elements.hpp" // for text, Element
|
||||
|
||||
namespace ftxui::animation {
|
||||
class Params;
|
||||
} // namespace ftxui::animation
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
namespace {
|
||||
@@ -101,6 +105,15 @@ bool ComponentBase::OnEvent(Event event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/// @brief Called in response to an animation event.
|
||||
/// @param animation_params the parameters of the animation
|
||||
/// The default implementation dispatch the event to every child.
|
||||
/// @ingroup component
|
||||
void ComponentBase::OnAnimation(animation::Params& params) {
|
||||
for (Component& child : children_)
|
||||
child->OnAnimation(params);
|
||||
}
|
||||
|
||||
/// @brief Return the currently Active child.
|
||||
/// @return the currently Active child.
|
||||
/// @ingroup component
|
||||
|
Reference in New Issue
Block a user