On Mon, Dec 15, 2014 at 11:44:37AM +0100, Ingo Weinhold wrote: > On 15.12.2014 11:15, pulkomandy@xxxxxxxxxxxxx wrote: > >LayoutItem: better documentation for SetExplicitMinSize. > > > >This is a bit counter-intuitive, at least to me, as forcing the minimal > >size can lead to the item being smaller than it would otherwise. > > > >---------------------------------------------------------------------------- > > > >diff --git a/docs/user/interface/LayoutItem.dox > >b/docs/user/interface/LayoutItem.dox > >index 6c85de1..3a73c09 100644 > >--- a/docs/user/interface/LayoutItem.dox > >+++ b/docs/user/interface/LayoutItem.dox > >@@ -164,6 +164,11 @@ > > \fn void BLayoutItem::SetExplicitMinSize(BSize size) = 0 > > \brief Set this item's explicit min size, to be used in MinSize(). > > > >+ This forces the minimal size for the item and overrides any constraints > >+ that would normally be used to compute it. Most importantly, the minimal > >+ size of children is ignored, so setting this can lead to the children > >not > >+ fitting the view. > >+ > > \since Haiku R1 > > */ > > I think it is only confusing, if the general concept is not clear. A view > (or layout item) has a minimum size, which is returned by MinSize(). > Generally this minimum size is unrelated to the children of the view. > Usually, however, it is computed from the size constraints of the children > and other properties (e.g. layout direction of BGroupLayout) either by the > view itself or by a layout set on the view. In either case, there still is > only this one minimum size, and it can be set/overridden explicitly by > SetExplicitMinSize(). There is no concept of additional view size > constraints. If you want those, you'll have to override MinSize(). > > I guess the SetExplicit*Size() methods should mention B_SIZE_UNSET, since > that is indeed not obvious. Probably someone with better understanding of how the layout computation works should write the documentation for it. -- Adrien.