File diff r28761:d984b313db3e → r28762:67d8065b03e1
src/widget.cpp
Show inline comments
 
@@ -1268,8 +1268,13 @@ void NWidgetStacked::AssignSizePosition(
 

	
 
void NWidgetStacked::FillWidgetLookup(WidgetLookup &widget_lookup)
 
{
 
	/* We need to update widget_lookup later. */
 
	this->widget_lookup = &widget_lookup;
 

	
 
	if (this->index >= 0) widget_lookup[this->index] = this;
 
	NWidgetContainer::FillWidgetLookup(widget_lookup);
 
	/* In case widget IDs are repeated, make sure Window::GetWidget works on displayed widgets. */
 
	if (static_cast<size_t>(this->shown_plane) < this->children.size()) this->children[shown_plane]->FillWidgetLookup(widget_lookup);
 
}
 

	
 
void NWidgetStacked::Draw(const Window *w)
 
@@ -1300,6 +1305,8 @@ bool NWidgetStacked::SetDisplayedPlane(i
 
{
 
	if (this->shown_plane == plane) return false;
 
	this->shown_plane = plane;
 
	/* In case widget IDs are repeated, make sure Window::GetWidget works on displayed widgets. */
 
	if (static_cast<size_t>(this->shown_plane) < this->children.size()) this->children[shown_plane]->FillWidgetLookup(*this->widget_lookup);
 
	return true;
 
}