diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-10-24 16:28:17 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-10-24 16:28:55 +0100 |
commit | e0c4e1f8b7258a3a6e38e4115c03e4315541a8de (patch) | |
tree | 2d58bde240e8b8d12b6790372b5501948b639883 /vcl | |
parent | Related fdo#46808: Adapt Windows-only code to previous changes (diff) | |
download | core-e0c4e1f8b7258a3a6e38e4115c03e4315541a8de.tar.gz core-e0c4e1f8b7258a3a6e38e4115c03e4315541a8de.zip |
honour padding property in VclBox
Change-Id: Ie387898535ec8f638c4a2a2785cdb39273136f0e
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/layout.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 9a7309546ac8..548e06e8d3c0 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -111,6 +111,11 @@ Size VclBox::calculateRequisition() const continue; ++nVisibleChildren; Size aChildSize = getLayoutRequisition(*pChild); + + long nPrimaryDimension = getPrimaryDimension(aChildSize); + nPrimaryDimension += pChild->get_padding() * 2; + setPrimaryDimension(aChildSize, nPrimaryDimension); + accumulateMaxes(aChildSize, aSize); } @@ -175,10 +180,10 @@ void VclBox::setAllocation(const Size &rAllocation) { aBoxSize = getLayoutRequisition(*pChild); long nPrimaryDimension = getPrimaryDimension(aBoxSize); - nPrimaryDimension += nPadding; - bool bExpand = pChild->get_expand(); - if (bExpand) - setPrimaryDimension(aBoxSize, nPrimaryDimension + nExtraSpace); + nPrimaryDimension += nPadding * 2; + if (pChild->get_expand()) + nPrimaryDimension += nExtraSpace; + setPrimaryDimension(aBoxSize, nPrimaryDimension); } setSecondaryDimension(aBoxSize, getSecondaryDimension(rAllocation)); |