All controls/views now accept NULL arguments for "width" and "height" in GetPreferredSize().

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15091 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-11-23 17:29:39 +00:00
parent f97761575a
commit 8643b0987c
9 changed files with 161 additions and 141 deletions
+15 -11
View File
@@ -1333,18 +1333,22 @@ BMenu::ComputeLayout(int32 index, bool bestFit, bool moveItems,
break;
}
// This is for BMenuBar.
if ((ResizingMode() & B_FOLLOW_LEFT_RIGHT) == B_FOLLOW_LEFT_RIGHT) {
if (Parent())
*_width = Parent()->Frame().Width() + 1;
else if (Window())
*_width = Window()->Frame().Width() + 1;
else
*_width = Bounds().Width();
} else
*_width = frame.Width();
// This is for BMenuBar
*_height = frame.Height();
if (_width) {
if ((ResizingMode() & B_FOLLOW_LEFT_RIGHT) == B_FOLLOW_LEFT_RIGHT) {
if (Parent())
*_width = Parent()->Frame().Width() + 1;
else if (Window())
*_width = Window()->Frame().Width() + 1;
else
*_width = Bounds().Width();
} else
*_width = frame.Width();
}
if (_height)
*_height = frame.Height();
}