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

View File

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