diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2010-08-31 18:59:45 +0200 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2010-08-31 18:59:45 +0200 |
commit | 793966da6c18295efd705637eb22c50370c986e7 (patch) | |
tree | 2802ca0d489e1fea3e32e489a9d3c72c14e24ff1 | |
parent | rebase to DEV300_m87 (diff) | |
download | core-793966da6c18295efd705637eb22c50370c986e7.tar.gz core-793966da6c18295efd705637eb22c50370c986e7.zip |
vcl115: #i113242# better layout for SwInputWindow
-rwxr-xr-x | sw/source/ui/ribbar/inputwin.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx index 9ee5a6e2ffa3..e6d7bf26db80 100755 --- a/sw/source/ui/ribbar/inputwin.cxx +++ b/sw/source/ui/ribbar/inputwin.cxx @@ -103,16 +103,23 @@ SwInputWindow::SwInputWindow( Window* pParent, SfxBindings* pBind ) SetDropdownClickHdl( LINK( this, SwInputWindow, DropdownClickHdl )); Size aSizeTbx = CalcWindowSizePixel(); + Size aEditSize = aEdit.GetSizePixel(); + Rectangle aItemRect( GetItemRect(FN_FORMULA_CALC) ); + long nMaxHeight = (aEditSize.Height() > aItemRect.GetHeight()) ? aEditSize.Height() : aItemRect.GetHeight(); + if( nMaxHeight+2 > aSizeTbx.Height() ) + aSizeTbx.Height() = nMaxHeight+2; Size aSize = GetSizePixel(); aSize.Height() = aSizeTbx.Height(); SetSizePixel( aSize ); - Size aPosSize = aPos.GetSizePixel(); - Size aEditSize = aEdit.GetSizePixel(); - aPosSize.Height() = aEditSize.Height() = GetItemRect(FN_FORMULA_CALC).GetHeight() - 2; - Point aPosPos = aPos.GetPosPixel(); - Point aEditPos= aEdit.GetPosPixel(); - aPosPos.Y() = aEditPos.Y() = GetItemRect( FN_FORMULA_CALC ).TopLeft().Y() + 1; + // align edit and item vcentered + Size aPosSize = aPos.GetSizePixel(); + aPosSize.Height() = nMaxHeight; + aEditSize.Height() = nMaxHeight; + Point aPosPos = aPos.GetPosPixel(); + Point aEditPos = aEdit.GetPosPixel(); + aPosPos.Y() = (aSize.Height() - nMaxHeight)/2 + 1; + aEditPos.Y() = (aSize.Height() - nMaxHeight)/2 + 1; aPos.SetPosSizePixel( aPosPos, aPosSize ); aEdit.SetPosSizePixel( aEditPos, aEditSize ); |