- MakeViewFor didn't return a view with a good default size when no hintRect was provided (as
in Cortex). This happened only when needing a tabbed view. It will now return a view with the most fitting size. This fixes #597 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25923 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -697,8 +697,8 @@ DefaultMediaTheme::MakeViewFor(BParameterWeb *web, const BRect *hintRect)
|
|||||||
BRect rect;
|
BRect rect;
|
||||||
if (hintRect)
|
if (hintRect)
|
||||||
rect = *hintRect;
|
rect = *hintRect;
|
||||||
else
|
|
||||||
rect.Set(0, 0, 80, 100);
|
BRect bestRect;
|
||||||
|
|
||||||
// do we have more than one attached parameter group?
|
// do we have more than one attached parameter group?
|
||||||
// if so, use a tabbed view with a tab for each group
|
// if so, use a tabbed view with a tab for each group
|
||||||
@@ -737,8 +737,23 @@ DefaultMediaTheme::MakeViewFor(BParameterWeb *web, const BRect *hintRect)
|
|||||||
|
|
||||||
return new DynamicScrollView(groupView->Name(), groupView);
|
return new DynamicScrollView(groupView->Name(), groupView);
|
||||||
}
|
}
|
||||||
|
|
||||||
tabView->AddTab(new DynamicScrollView(groupView->Name(), groupView));
|
DynamicScrollView *scrollView = new DynamicScrollView(groupView->Name(), groupView);
|
||||||
|
tabView->AddTab(scrollView);
|
||||||
|
|
||||||
|
if (!hintRect) {
|
||||||
|
bestRect = bestRect | scrollView->Bounds();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tabView != NULL) {
|
||||||
|
// this adjustment must be kept in sync with TabView::FrameResized
|
||||||
|
bestRect.bottom += tabView->TabHeight();
|
||||||
|
bestRect.InsetBy(-3.0,-3.0);
|
||||||
|
|
||||||
|
tabView->ResizeTo(bestRect.Width(), bestRect.Height());
|
||||||
|
tabView->FrameResized(bestRect.Width(), bestRect.Height());
|
||||||
|
//needed since we're not attached to a window yet
|
||||||
}
|
}
|
||||||
|
|
||||||
return tabView;
|
return tabView;
|
||||||
|
|||||||
Reference in New Issue
Block a user