Fix BMenu behaviour/ABI by reinstating BMenu::InvalidateLayout()

It turns out,this is an old method added by Be, and is not really related to BView::InvalidateLayout(bool). In fact BMenu::InvalidateLayout() does something separate, but related to the BView method. I was wrong to delete this method, since it needs to have action taken each time it is called, so moving these actions into LayoutInvalidated() only worked sometimes (when the BView was considered to have a valid layout).

I have added a comment for future hackers so that they don't delete this method.
This commit is contained in:
Alex Wilson 2011-12-08 14:09:35 -07:00
parent 8f0b7c3fb8
commit 29ef6eb52d
2 changed files with 13 additions and 0 deletions

View File

@ -78,6 +78,8 @@ public:
virtual void FrameMoved(BPoint newPosition);
virtual void FrameResized(float newWidth, float newHeight);
void InvalidateLayout();
virtual void MakeFocus(bool focus = true);
bool AddItem(BMenuItem* item);

View File

@ -667,6 +667,17 @@ BMenu::FrameResized(float new_width, float new_height)
}
void
BMenu::InvalidateLayout()
{
fUseCachedMenuLayout = false;
// This method exits for backwards compatibility reasons, it is used to
// invalidate the menu layout, but we also use call
// BView::InvalidateLayout() for good measure. Don't delete this method!
BView::InvalidateLayout(false);
}
// #pragma mark -