Fix problem detecting Timeline widgets when it's hidden

This commit is contained in:
David Capello 2015-08-20 09:09:49 -03:00
parent 7b0013d5a1
commit 835fe40540
2 changed files with 7 additions and 5 deletions

View File

@ -408,16 +408,18 @@ Widget* Widget::getPreviousSibling()
return *(++it);
}
Widget* Widget::pick(const gfx::Point& pt)
Widget* Widget::pick(const gfx::Point& pt, bool checkParentsVisibility)
{
Widget* inside, *picked = nullptr;
if (!hasFlags(HIDDEN) && // Is visible
getBounds().contains(pt)) { // The point is inside the bounds
// isVisible() checks visibility of widget's parent.
if (((checkParentsVisibility && isVisible()) ||
(!checkParentsVisibility && !hasFlags(HIDDEN))) &&
(getBounds().contains(pt))) {
picked = this;
for (Widget* child : m_children) {
inside = child->pick(pt);
inside = child->pick(pt, false);
if (inside) {
picked = inside;
break;

View File

@ -184,7 +184,7 @@ namespace ui {
Widget* getNextSibling();
Widget* getPreviousSibling();
Widget* pick(const gfx::Point& pt);
Widget* pick(const gfx::Point& pt, bool checkParentsVisibility = true);
bool hasChild(Widget* child);
bool hasAncestor(Widget* ancestor);
Widget* findChild(const char* id);