BMenuItem also draws ctrl bitmap if needed, BTextView::AutoResize implemented more correctly

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16577 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2006-03-03 19:31:09 +00:00
parent da2e259d76
commit 2c11ec31c8
5 changed files with 41 additions and 23 deletions
+2 -4
View File
@@ -4090,15 +4090,13 @@ BTextView::UpdateScrollbars()
void
BTextView::AutoResize(bool doredraw)
{
// TODO: What about fContainerView ? Should we resize it as well ?
if (fResizable) {
float width = 0;
for (int32 i = 0; i < CountLines(); i++)
width = max_c(width, LineWidth(i));
ResizeTo(width, max_c(Bounds().Height(), TextHeight(0, CountLines())));
if (fContainerView)
fContainerView->ResizeTo(Bounds().Width(), Bounds().Height());
BView *viewToResize = fContainerView != NULL ? fContainerView : this;
viewToResize->ResizeTo(width, max_c(Bounds().Height(), TextHeight(0, CountLines())));
}
}