UI: send events to children in reverse order
This commit is contained in:
parent
1d0d90862e
commit
e6506062b0
1 changed files with 3 additions and 2 deletions
|
|
@ -81,8 +81,9 @@ namespace psemek::ui
|
||||||
bool controller::impl::event(E const & e)
|
bool controller::impl::event(E const & e)
|
||||||
{
|
{
|
||||||
auto visitor = util::recursive([&](auto && self, element * elem) -> bool {
|
auto visitor = util::recursive([&](auto && self, element * elem) -> bool {
|
||||||
for (auto c : elem->children())
|
auto cs = elem->children();
|
||||||
if (c && self(c)) return true;
|
for (auto it = cs.rbegin(); it != cs.rend(); ++it)
|
||||||
|
if (*it && self(*it)) return true;
|
||||||
|
|
||||||
if (elem->enabled() && elem->on_event(e)) return true;
|
if (elem->enabled() && elem->on_event(e)) return true;
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue