cursive icon indicating copy to clipboard operation
cursive copied to clipboard

Improve `View::take_focus` behaviour with mouse events.

Open gyscos opened this issue 4 years ago • 0 comments

When take_focus is caused by a mouse event, source = Direction::none() may not be enough to decide whether to take the focus or now.

Example: a LinearLayout with two children, only one of them focusable. If a mouse click falls on the non-focusable child, should the LinearLayout take focus? And transmit it to the other, focusable child?

One solution for that is to add a new type of absolute direction: maybe Absolute::Target(Vec2), used for focus caused by mouse events. Or maybe give Absolute::None an Option<Vec2> target?

gyscos avatar Jun 17 '20 01:06 gyscos