mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
add 'onmouseenter', 'onmouseleave' ui events
This commit is contained in:
parent
d457b2ee7f
commit
78e0ac5a95
5 changed files with 36 additions and 1 deletions
|
|
@ -52,6 +52,10 @@ void UINode::setHover(bool flag) {
|
|||
return;
|
||||
}
|
||||
hover = flag;
|
||||
actions.notify(flag ? UIAction::MOUSE_ENTER : UIAction::MOUSE_LEAVE, gui);
|
||||
}
|
||||
|
||||
void UINode::setMouseOver(bool flag) {
|
||||
actions.notify(flag ? UIAction::MOUSE_OVER : UIAction::MOUSE_OUT, gui);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,9 @@ namespace gui {
|
|||
DEFOCUS,
|
||||
RIGHT_CLICK,
|
||||
MOUSE_OVER,
|
||||
MOUSE_OUT
|
||||
MOUSE_OUT,
|
||||
MOUSE_ENTER,
|
||||
MOUSE_LEAVE,
|
||||
};
|
||||
|
||||
using ActionsSet = TaggedCallbacksSet<UIAction, GUI&>;
|
||||
|
|
@ -170,8 +172,11 @@ namespace gui {
|
|||
virtual void setHover(bool flag);
|
||||
bool isHover() const;
|
||||
|
||||
void setMouseOver(bool flag);
|
||||
|
||||
virtual void setParent(UINode* node);
|
||||
UINode* getParent() const;
|
||||
std::shared_ptr<UINode> getParentShared() const;
|
||||
|
||||
/// @brief Set element color (doesn't affect inner elements).
|
||||
/// Also replaces hover color to avoid adding extra properties
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue