Fix bug showing marching ants from a hidden app::Editor

Widget::isVisible() must return false if the widget isn't
inside a ui::Manager
This commit is contained in:
David Capello 2015-03-26 10:49:12 -03:00
parent 620b206b23
commit 70b0495fdb

View File

@ -288,15 +288,18 @@ void Widget::setFocusMagnet(bool state)
bool Widget::isVisible() const bool Widget::isVisible() const
{ {
const Widget* widget = this; const Widget* widget = this;
const Widget* lastWidget = nullptr;
do { do {
if (widget->flags & JI_HIDDEN) if (widget->flags & JI_HIDDEN)
return false; return false;
lastWidget = widget;
widget = widget->m_parent; widget = widget->m_parent;
} while (widget); } while (widget);
return true; // The widget is visible if it's inside a visible manager
return (lastWidget ? lastWidget->type == kManagerWidget: false);
} }
bool Widget::isEnabled() const bool Widget::isEnabled() const