Don't draw or send events to hidden ui children
This commit is contained in:
parent
e6506062b0
commit
03acb43dc4
1 changed files with 3 additions and 0 deletions
|
|
@ -81,6 +81,8 @@ namespace psemek::ui
|
|||
bool controller::impl::event(E const & e)
|
||||
{
|
||||
auto visitor = util::recursive([&](auto && self, element * elem) -> bool {
|
||||
if (elem->hidden()) return false;
|
||||
|
||||
auto cs = elem->children();
|
||||
for (auto it = cs.rbegin(); it != cs.rend(); ++it)
|
||||
if (*it && self(*it)) return true;
|
||||
|
|
@ -182,6 +184,7 @@ namespace psemek::ui
|
|||
gl::Disable(gl::CULL_FACE);
|
||||
|
||||
auto visitor = util::recursive([&](auto && self, element * elem) -> void {
|
||||
if (elem->hidden()) return;
|
||||
elem->draw(impl().painter);
|
||||
for (auto c : elem->children())
|
||||
if (c) self(c);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue