mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 06:21:50 +00:00
update uinode hover semantics
This commit is contained in:
parent
78e0ac5a95
commit
79e4a28b4d
2 changed files with 2 additions and 5 deletions
|
|
@ -135,7 +135,7 @@ void GUI::actMouse(float delta, const CursorState& cursor) {
|
||||||
if (this->hover && this->hover != hover) {
|
if (this->hover && this->hover != hover) {
|
||||||
this->hover->setHover(false);
|
this->hover->setHover(false);
|
||||||
}
|
}
|
||||||
if (hover) {
|
if (hover && hover != this->hover) {
|
||||||
hover->setHover(true);
|
hover->setHover(true);
|
||||||
|
|
||||||
int scroll = input.getScroll();
|
int scroll = input.getScroll();
|
||||||
|
|
|
||||||
|
|
@ -48,14 +48,11 @@ void UINode::setAlign(Align align) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UINode::setHover(bool flag) {
|
void UINode::setHover(bool flag) {
|
||||||
if (hover == flag) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
hover = flag;
|
|
||||||
actions.notify(flag ? UIAction::MOUSE_ENTER : UIAction::MOUSE_LEAVE, gui);
|
actions.notify(flag ? UIAction::MOUSE_ENTER : UIAction::MOUSE_LEAVE, gui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UINode::setMouseOver(bool flag) {
|
void UINode::setMouseOver(bool flag) {
|
||||||
|
hover = flag;
|
||||||
actions.notify(flag ? UIAction::MOUSE_OVER : UIAction::MOUSE_OUT, gui);
|
actions.notify(flag ? UIAction::MOUSE_OVER : UIAction::MOUSE_OUT, gui);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue