23#include "guillaume/components/mouse_hover_interaction.hpp"
79 utility::graphic::SizeUI
82 return _accessibilityMargin;
86 const utility::graphic::SizeUI &margin)
88 if (_accessibilityMargin == margin) {
91 _accessibilityMargin = margin;
Whether the mouse pointer is over an entity, what to call when it enters or leaves,...
HoverHandler getOnHoverHandler(void) const
Get the callback run when the pointer enters the entity.
MouseHoverInteraction & setHovered(bool isHovered)
Record whether the pointer is over the entity.
UnhoverHandler getOnUnhoverHandler(void) const
Get the callback run when the pointer leaves the entity.
MouseHoverInteraction & setOnUnhoverHandler(const UnhoverHandler &handler)
Store the callback run when the pointer leaves the entity.
std::function< void(void)> UnhoverHandler
Called on hover end.
MouseHoverInteraction(void)
Construct a component that is not hovered, has no handler and no margin.
utility::graphic::SizeUI getAccessibilityMargin(void) const
Get the hit area added around the bound.
bool isHovered(void) const
Check whether the pointer is over the entity.
MouseHoverInteraction & setAccessibilityMargin(const utility::graphic::SizeUI &margin)
Grow the hit area past the bound without growing the entity on screen.
std::function< void(void)> HoverHandler
Called on hover start.
MouseHoverInteraction & setOnHoverHandler(const HoverHandler &handler)
Store the callback run when the pointer enters the entity.
Component(void)=default
Create a component that is not marked as changed.
void setHasChanged(bool hasChanged)
Raise or lower the changed flag.
State. Every class here is plain data attached to an entity.
The entity-component-system core, independent of any widget.