Kaydet (Commit) 829b0564 authored tarafından Maxim Monastirsky's avatar Maxim Monastirsky

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/48094Reviewed-by: 's avatarMaxim Monastirsky <momonasmon@gmail.com>
Tested-by: 's avatarMaxim Monastirsky <momonasmon@gmail.com>
üst fa68bed1
......@@ -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
......
......@@ -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;
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment