From b6bf3346f38510bfffc1bbe97b20665cbd92c6eb Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Tue, 8 Aug 2006 14:07:09 +0000 Subject: [PATCH] When calculating the menu frame, take the resizeToFit parameter into account. This fixes bug 574, although the implementation isn't probably completed yet. Needs more investigation. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18459 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Menu.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index d6df6e8856..a84ccec94b 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -328,7 +328,8 @@ BMenu::AttachedToWindow() if (!fAttachAborted) { CacheFontInfo(); - LayoutItems(0); + LayoutItems(0); + //UpdateWindowViewSize(); } } @@ -1581,8 +1582,11 @@ BMenu::ComputeLayout(int32 index, bool bestFit, bool moveItems, for (int32 i = 0; i < fItems.CountItems(); i++) ItemAt(i)->fBounds.bottom = frame.bottom; } - - frame.right = ceilf(frame.right); + + if (bestFit) + frame.right = ceilf(frame.right); + else + frame.right = Bounds().right; break; } @@ -2065,10 +2069,7 @@ BMenu::ChooseTrigger(const char *title, BList *chars) void BMenu::UpdateWindowViewSize(bool upWind) { - BWindow *window = Window(); - - ASSERT(window != NULL); - + BWindow *window = Window(); if (window == NULL) return;