Fixes has_widget for grids.

This reapplies 2012-05-13T13:33:33Z!koraq@xs4all.nl and resolves the issue found in 
2012-05-13T18:03:56Z!koraq@xs4all.nl.
This commit is contained in:
Mark de Wever 2012-05-15 18:24:50 +00:00
parent 2bcafec78b
commit 4677d5f33e
2 changed files with 6 additions and 2 deletions

View file

@ -97,7 +97,7 @@ public:
/** Inherited from twidget.*/
bool has_widget(const twidget* widget) const
{ return grid_.has_widget(widget); }
{ return twidget::has_widget(widget) || grid_.has_widget(widget); }
/** Inherited from twidget. */
void set_origin(const tpoint& origin);

View file

@ -627,8 +627,12 @@ const twidget* tgrid::find(const std::string& id,
bool tgrid::has_widget(const twidget* widget) const
{
if(twidget::has_widget(widget)) {
return true;
}
foreach(const tchild& child, children_) {
if(child.widget() == /*->has_widget*/(widget)) {
if(child.widget()->has_widget(widget)) {
return true;
}
}