Also override MinSize() and PreferredSize().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21464 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -81,7 +81,9 @@ public:
|
||||
|
||||
|
||||
// layout related
|
||||
virtual BSize MinSize();
|
||||
virtual BSize MaxSize();
|
||||
virtual BSize PreferredSize();
|
||||
|
||||
/*----- Private or reserved -----------------------------------------*/
|
||||
virtual status_t Perform(perform_code d, void *arg);
|
||||
|
||||
@@ -327,15 +327,26 @@ BMenuBar::Perform(perform_code d, void *arg)
|
||||
}
|
||||
|
||||
|
||||
BSize
|
||||
BMenuBar::MinSize()
|
||||
{
|
||||
return BMenu::MinSize();
|
||||
}
|
||||
|
||||
|
||||
BSize
|
||||
BMenuBar::MaxSize()
|
||||
{
|
||||
// TODO: cache the result
|
||||
float width, height;
|
||||
GetPreferredSize(&width, &height);
|
||||
|
||||
BSize size = BMenu::MaxSize();
|
||||
return BLayoutUtils::ComposeSize(ExplicitMaxSize(),
|
||||
BSize(B_SIZE_UNLIMITED, height));
|
||||
BSize(B_SIZE_UNLIMITED, size.height));
|
||||
}
|
||||
|
||||
|
||||
BSize
|
||||
BMenuBar::PreferredSize()
|
||||
{
|
||||
return BMenu::PreferredSize();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user