MonoGame.Extended icon indicating copy to clipboard operation
MonoGame.Extended copied to clipboard

[GUI] The layout control should be hovered as well when its child control is hovered

Open wutipong opened this issue 6 years ago • 0 comments

What's happening is, suppose there's a GuiLayoutControl which have Hovered style and contains children controls. If the mouse is moved to the layout control's child, the layout control loses its hovered status (even if the mouse is still inside the layout control). Only the child displays with hovered style.

I think, in this case, both layout controls and child control should become hovered, in contrast to the child alone like what it is currently.

There are two ways to implement this I believe, one is to make the parent become hovered once the hovering control is identified, another way is the exact opposite, the control becomes covered first and then it makes its children become hovered as well. Can't say exactly what is preferred here.

Anyway, I have played with it a little bit (using the latter approach). Here's my code https://github.com/wutipong/MonoGame.Extended/tree/cascade_ptr_event .

wutipong avatar Oct 03 '17 13:10 wutipong