[haiku-development] Re: Putting a BGridView inside BScrollView

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 14 Nov 2010 13:08:06 +0100

On 2010-11-14 at 12:19:10 [+0100], Michael Pfeiffer 
<michael.w.pfeiffer@xxxxxxxxx> wrote:
> In the code inside the comment:
> http://dev.haiku-os.org/browser/haiku/trunk/src/libs/print/libprint/JobSetupDlg.cpp?rev=39423#L370
> I want to put a BGridView inside a BScrollView using the Layout API.
> However when the window is displayed, the parent view containing the
> BScrollView still has the size of the BGridView, and the BScrollView
> is vertically centered inside the parent view.
> 
> Parent view:
> +------+
> |      |
> |+----+|
> ||    || <- BScrollView
> |+----+|
> |      |
> +------+
> 
> BTW in the code the parent view is a BBox.
> 
> Any ideas what I do wrong and how to solve the problem?

I wouldn't rule out that there are still bugs related to BScrollView, but 
from your description I'd say that the grid view has a maximum size limit 
that forces a maximum size limit on the scroll view. So what you're seeing is 
the scroll view having hit is maximum size and its parent view having no 
other choice than to center it in the available space.

You should check what is causing the grid view's maximum size limit and try 
to remedy that, e.g. by adding glue. If that's not desirable for some reason 
you could override the maximum size limit on the grid view or on the scroll 
view (with different results). Setting an explicit alignment of 
B_ALIGN_USE_FULL_{WIDTH,HEIGHT} on the scroll view is yet another option. The 
size limit will still be propagated to the parent view, but the scroll view 
will use all space that is available (instead of being centered in it).

CU, Ingo

Other related posts: