BMenu::InvalidateLayout() should only sets a variable, the real invalidation is done on Draw() or AttachedToWindow() (like on R5). This fixes bug 567 (at least the crash in HotEdit)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17356 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -284,8 +284,10 @@ BMenu::AttachedToWindow()
|
||||
} while (AddDynamicItem(B_PROCESSING));
|
||||
}
|
||||
|
||||
if (!fAttachAborted)
|
||||
InvalidateLayout();
|
||||
if (!fAttachAborted) {
|
||||
CacheFontInfo();
|
||||
LayoutItems(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -742,6 +744,14 @@ BMenu::KeyDown(const char *bytes, int32 numBytes)
|
||||
void
|
||||
BMenu::Draw(BRect updateRect)
|
||||
{
|
||||
if (!fUseCachedMenuLayout) {
|
||||
fUseCachedMenuLayout = true;
|
||||
CacheFontInfo();
|
||||
LayoutItems(0);
|
||||
Invalidate();
|
||||
return;
|
||||
}
|
||||
|
||||
DrawBackground(updateRect);
|
||||
DrawItems(updateRect);
|
||||
}
|
||||
@@ -778,9 +788,7 @@ BMenu::FrameResized(float new_width, float new_height)
|
||||
void
|
||||
BMenu::InvalidateLayout()
|
||||
{
|
||||
CacheFontInfo();
|
||||
LayoutItems(0);
|
||||
Invalidate();
|
||||
fUseCachedMenuLayout = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user