implemented centered button box mode

Change-Id: I17b60440297d4eecca0737f811f6e56cc5bc91ce
This commit is contained in:
Caolán McNamara
2013-09-09 14:15:14 +01:00
parent 11f50dfa91
commit 6e836a56ee

View File

@@ -569,6 +569,15 @@ void VclButtonBox::setAllocation(const Size &rAllocation)
setPrimaryCoordinate(aMainGroupPos, nSpacing);
}
break;
case VCL_BUTTONBOX_CENTER:
if (!aReq.m_aMainGroupDimensions.empty())
{
long nMainPrimaryDimension = getPrimaryDimension(
addSpacing(aReq.m_aMainGroupSize, aReq.m_aMainGroupDimensions.size()));
long nExtraSpace = nAllocPrimaryDimension - nMainPrimaryDimension;
setPrimaryCoordinate(aMainGroupPos, nExtraSpace/2);
}
break;
default:
SAL_WARN("vcl.layout", "todo unimplemented layout style");
case VCL_BUTTONBOX_DEFAULT_STYLE: