Elements detect when children are hovered over
This commit is contained in:
parent
e3af067972
commit
031c61146b
33 changed files with 153 additions and 185 deletions
|
|
@ -5,28 +5,25 @@ namespace GUIStuff {
|
|||
|
||||
LayoutElement::LayoutElement(GUIManager& gui): Element(gui) {}
|
||||
|
||||
void LayoutElement::layout(const Clay_ElementId& id, const std::function<void(const Clay_ElementId&)>& layout, const Callbacks& c) {
|
||||
void LayoutElement::layout(const Clay_ElementId& id, const std::function<void(LayoutElement*, const Clay_ElementId&)>& layout, const Callbacks& c) {
|
||||
this->c = c;
|
||||
layout(id);
|
||||
layout(this, id);
|
||||
}
|
||||
|
||||
void LayoutElement::input_mouse_button_callback(const InputManager::MouseButtonCallbackArgs& button, bool mouseHovering) {
|
||||
if(c.mouseButton) c.mouseButton(button, mouseHovering);
|
||||
return Element::input_mouse_button_callback(button, mouseHovering);
|
||||
void LayoutElement::input_mouse_button_callback(const InputManager::MouseButtonCallbackArgs& button) {
|
||||
if(c.mouseButton) c.mouseButton(this, button);
|
||||
}
|
||||
|
||||
void LayoutElement::input_mouse_motion_callback(const InputManager::MouseMotionCallbackArgs& motion, bool mouseHovering) {
|
||||
if(c.mouseMotion) c.mouseMotion(motion, mouseHovering);
|
||||
return Element::input_mouse_motion_callback(motion, mouseHovering);
|
||||
void LayoutElement::input_mouse_motion_callback(const InputManager::MouseMotionCallbackArgs& motion) {
|
||||
if(c.mouseMotion) c.mouseMotion(this, motion);
|
||||
}
|
||||
|
||||
void LayoutElement::input_mouse_wheel_callback(const InputManager::MouseWheelCallbackArgs& wheel, bool mouseHovering) {
|
||||
if(c.mouseWheel) c.mouseWheel(wheel, mouseHovering);
|
||||
return Element::input_mouse_wheel_callback(wheel, mouseHovering);
|
||||
void LayoutElement::input_mouse_wheel_callback(const InputManager::MouseWheelCallbackArgs& wheel) {
|
||||
if(c.mouseWheel) c.mouseWheel(this, wheel);
|
||||
}
|
||||
|
||||
void LayoutElement::input_key_callback(const InputManager::KeyCallbackArgs& key) {
|
||||
if(c.key) c.key(key);
|
||||
if(c.key) c.key(this, key);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue