menu_view: fix hover reporting

The 'Widget::hovered' method discarded the result of the traversal of
the widget tree.
This commit is contained in:
Norman Feske 2018-03-07 17:29:32 +01:00 committed by Christian Helmuth
parent 8e9390e964
commit 3887ba8a21

View File

@ -227,14 +227,14 @@ class Menu_view::Widget : public List_model<Widget>::Element
if (!_inner_geometry().contains(at))
return Unique_id();
Unique_id result { };
Unique_id result = _unique_id;
_children.for_each([&] (Widget const &w) {
Unique_id const id = w.hovered(at - w.geometry().p1());
if (id.valid())
result = id;
});
return _unique_id;
return result;
}
void print(Output &out) const