[haiku-development] Re: BBox and layout
- From: Clemens <clemens.zeidler@xxxxxxxxxxxxxx>
- To: haiku-development@xxxxxxxxxxxxx
- Date: Mon, 07 May 2012 11:27:24 +1200
The reason the label is laid out is because it is a child of the view, andall children are part of the layout (or a nested layout). The removal of the child for the layout is the way to circumvent this. The infinite loopshould be avoidable using the {Disable|Enable}LayoutInvalidation() methods.
cool thank! tried it but it did not work very well. I called the BView::{Disable|Enable}LayoutInvalidation() but when adding a item to the layout the BView::_InvalidateParentLayout() is called (from BLayout::AddItem) which does not check if the layout invalidation is disabled. Adding the check there helps though. However, additionally calling BLayout::{Disable|Enable}LayoutInvalidation() solves the problem. What is the cleanest solution? and why are there flags for layout invalidation in BView and BLayout shouldn't BView just use the one from BLayout?
2) When setting a layout to a BBox its a bit annoying to set the correctlayout inset so that the content is exactly within the inner BBox frame. Itwould be nice to have some convenient function to set the inset to the layout. Or even better: the layout of a BBox is moved automatically into the inner frame so that it is not event possible to place a layout item outside the inner frame. What do you think?It is annoying indeed. One solution would be to add a BLayout subclass that does a BBox layout, including the label and a single nested item (possibly another BLayout). Otherwise, if you wanted to keep the current system, but let BBox manage the insets of the layout it is assigned that could be doneif SetInsets() were a part of BLayout(). Currently it's not, but it is implemented by all layouts (assuming BCardLayout does), so it could be alright to make it part of BLayout. If there were a layout at some pointthat couldn't reasonably support insets, it would be ok if it just ignoredwhatever insets the user set.
Think its not the best idea to set the inset of an layout form within the BBox. Maybe the user already set the inset, this inset would be overwritten and cause unexpected behaviour... Think your first solution would be better. The question is should there be a method SetInnerLayout or should SetLayout set the inner layout directly? My first guest was that SetLayout does the right thing for me and so I would vote for just SetLayout to make it intuitive. If someone really has to have a layout that spans the whole BBox frame one could add a method like SetLayoutInInnerFrame(bool inFrame = true) to enable or disable this behaviour.
Cheers,
Clemens
- Follow-Ups:
- [haiku-development] Re: BBox and layout
- From: Alex Wilson
- [haiku-development] Re: BBox and layout
- References:
- [haiku-development] BBox and layout
- From: Clemens
- [haiku-development] Re: BBox and layout
- From: Alex Wilson
- [haiku-development] BBox and layout
Other related posts:
- » [haiku-development] BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - Ingo Weinhold
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Stephan Aßmus
- » [haiku-development] Re: BBox and layout - Axel Dörfler
- » [haiku-development] Re: BBox and layout - Clemens Zeidler
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - clemens . zeidler
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - Axel Dörfler
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Ingo Weinhold
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Ingo Weinhold
- » [haiku-development] Re: BBox and layout - Stephan Aßmus
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Ingo Weinhold
- » [haiku-development] Re: BBox and layout - pulkomandy
- » [haiku-development] Re: BBox and layout - Clemens Zeidler
- » [haiku-development] Re: BBox and layout - Clemens Zeidler
- » [haiku-development] Re: BBox and layout - Ingo Weinhold
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - Clemens Zeidler
- » [haiku-development] Re: BBox and layout - Ingo Weinhold
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Ingo Weinhold
- » [haiku-development] Re: BBox and layout - Clemens Zeidler
- » [haiku-development] Re: BBox and layout - Ingo Weinhold