diff --git a/headers/os/interface/ScrollView.h b/headers/os/interface/ScrollView.h index 7600a8f118..9901bb4d4d 100644 --- a/headers/os/interface/ScrollView.h +++ b/headers/os/interface/ScrollView.h @@ -1,5 +1,5 @@ /* - * Copyright 2004-2008, Haiku Inc. All Rights Reserved. + * Copyright 2004-2009, Haiku Inc. All Rights Reserved. * Distributed under the terms of the MIT license. */ #ifndef _SCROLL_VIEW_H @@ -68,6 +68,7 @@ public: virtual status_t GetSupportedSuites(BMessage* data); virtual BSize MinSize(); + virtual BSize MaxSize(); virtual BSize PreferredSize(); virtual void InvalidateLayout(bool descendants = false); diff --git a/src/kits/interface/ScrollView.cpp b/src/kits/interface/ScrollView.cpp index 15ec67585b..5dad5b90fe 100644 --- a/src/kits/interface/ScrollView.cpp +++ b/src/kits/interface/ScrollView.cpp @@ -1,10 +1,10 @@ /* - * Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2004-2009, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ -#include -#include + +#include #include #include @@ -747,6 +747,16 @@ BScrollView::MinSize() } +BSize +BScrollView::MaxSize() +{ + BSize size = _ComputeSize(fTarget != NULL ? fTarget->MaxSize() + : BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED)); + + return BLayoutUtils::ComposeSize(ExplicitMinSize(), size); +} + + BSize BScrollView::PreferredSize() {