summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-09-09 14:15:14 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-09-09 14:19:12 +0100
commit6e836a56ee42f0cfbd69f068ccdcd9a6085e60f0 (patch)
tree2ae48d6e999e5d218e68af129b78dc90062bc7aa
parent11f50dfa91ae382d59e751fa33c98d5478a2d52b (diff)
implemented centered button box mode
Change-Id: I17b60440297d4eecca0737f811f6e56cc5bc91ce
-rw-r--r--vcl/source/window/layout.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 30a6c84a96b3..7bfcb8cd1caa 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -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: