diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-12-17 12:27:14 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-12-17 13:05:30 +0000 |
commit | 2b34b48aacc10cbe256064f7606a114e232f3695 (patch) | |
tree | 30a1f59d6c4e087fdc57492af201c5f7e64ca4ea /vcl/source/window/dockwin.cxx | |
parent | 29ebb0ea9dd5371a4951ca55b88f7bebf85d04b9 (diff) |
try to get reasonable sizes for docking windows
start docked, move to undocked
start undocked, move to dock, back to undocked
start undocked, with and without size saved in settings and restored
Change-Id: I0bfdceb11aabdf9fdb855b97433b2af0532e4d03
Diffstat (limited to 'vcl/source/window/dockwin.cxx')
-rw-r--r-- | vcl/source/window/dockwin.cxx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 8c9641eaab78..cc3902b60222 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -833,9 +833,6 @@ void DockingWindow::SetFloatingMode( bool bFloatMode ) pWin->SetRollUpOutputSizePixel( maRollUpOutSize ); pWin->SetMinOutputSizePixel( maMinOutSize ); - pWin->set_width_request(std::max(aSize.Width(), maMinOutSize.Width())); - pWin->set_height_request(std::max(aSize.Height(), maMinOutSize.Height())); - pWin->SetMaxOutputSizePixel( mpImplData->maMaxOutSize ); ToggleFloatingMode(); @@ -1106,4 +1103,21 @@ void DockingWindow::setPosSizeOnContainee(Size aSize, Window &rBox) VclContainer::setLayoutAllocation(rBox, aPos, aSize); } +Size DockingWindow::GetOptimalSize() const +{ + if (!isLayoutEnabled()) + return Window::GetOptimalSize(); + + Size aSize = VclContainer::getLayoutRequisition(*GetWindow(WINDOW_FIRSTCHILD)); + + sal_Int32 nBorderWidth = get_border_width(); + + aSize.Height() += mpWindowImpl->mnLeftBorder + mpWindowImpl->mnRightBorder + + 2*nBorderWidth; + aSize.Width() += mpWindowImpl->mnTopBorder + mpWindowImpl->mnBottomBorder + + 2*nBorderWidth; + + return Window::CalcWindowSize(aSize); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |