diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2018-01-17 21:08:59 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2018-01-18 21:49:08 +0100 |
commit | 829b0564959411d0cc64169fe69153a714050c0d (patch) | |
tree | f23b32a702fdba903c0ae7153c1f0ab833a743d1 /vcl | |
parent | fa68bed11c180ebb0d45fb7779d538098b2921ff (diff) |
tdf#115057 Never use ImplPopupFloatWin for anything except ToolBox
ImplPopupFloatWin draws the window title and frame directly on the client
window, which is incompatible with .ui layouts, as they try to occupy the
whole available space. Instead just use a plain FloatingWindow whenever
possible, and change the border window code to mimic the behavior of
ImplPopupFloatWin, wrt removing part of the frame of toolbar popups w/o a
title.
Change-Id: If72ea89e31f913470faad7fcb8083f9b9787c9a8
Reviewed-on: https://gerrit.libreoffice.org/48094
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Tested-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/brdwin.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/dockmgr.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/floatwin.cxx | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index c929d0be35f8..5d8b14c7cde9 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -1418,7 +1418,7 @@ void ImplStdBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, con vcl::Region oldClipRgn(rRenderContext.GetClipRegion()); // for popups, don't draw part of the frame - if (pData->mnTitleType == BorderWindowTitleType::Popup) + if (pData->mnTitleType >= BorderWindowTitleType::Popup) { FloatingWindow* pWin = dynamic_cast<FloatingWindow*>(pData->mpBorderWindow->GetWindow(GetWindowType::Client)); if (pWin) @@ -1444,7 +1444,7 @@ void ImplStdBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, con --aInRect.Bottom(); // restore - if (pData->mnTitleType == BorderWindowTitleType::Popup) + if (pData->mnTitleType >= BorderWindowTitleType::Popup) rRenderContext.SetClipRegion(oldClipRgn); // Draw Border diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index ef290c642ced..57b83e568215 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -933,7 +933,7 @@ void ImplDockingWindowWrapper::ImplPreparePopupMode( FloatWinPopupFlags nFlags ) mpOldBorderWin = nullptr; // no border window found bool bAllowTearOff = bool( nFlags & FloatWinPopupFlags::AllowTearOff ); - bool bUseStdPopup = bAllowTearOff && GetWindow()->GetType() != WindowType::TOOLBOX; + bool bUseStdPopup = GetWindow()->GetType() != WindowType::TOOLBOX; // the new parent for popup mode VclPtr<FloatingWindow> pWin; diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 6377c6c6f853..304fadb40eb9 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -427,7 +427,7 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow, aPos = pW->AbsoluteScreenToOutputPixel( aPos ); // store a cliprect that can be used to clip the common edge of the itemrect and the floating window - if( pFloatingWindow ) + if( pFloatingWindow && pFloatingWindow->mpImplData->mpBox ) { pFloatingWindow->mpImplData->maItemEdgeClipRect = tools::Rectangle( e1, e2 ); |