Add the Hoverable wrapper. (#522)

This will make it easier for developers. For instance:
https://github.com/ArthurSonzogni/FTXUI/issues/521
This commit is contained in:
Arthur Sonzogni (slow/sick)
2022-12-04 11:54:49 +01:00
committed by GitHub
parent f21ca3aa14
commit 0d54285e19
6 changed files with 379 additions and 1 deletions

View File

@@ -110,6 +110,18 @@ ComponentDecorator Modal(Component modal, const bool* show_modal);
Component Collapsible(ConstStringRef label,
Component child,
Ref<bool> show = false);
Component Hoverable(Component component, bool* hover);
Component Hoverable(Component component,
std::function<void()> on_enter,
std::function<void()> on_leave);
Component Hoverable(Component component, //
std::function<void(bool)> on_change);
ComponentDecorator Hoverable(bool* hover);
ComponentDecorator Hoverable(std::function<void()> on_enter,
std::function<void()> on_leave);
ComponentDecorator Hoverable(std::function<void(bool)> on_change);
} // namespace ftxui
#endif /* end of include guard: FTXUI_COMPONENT_HPP */