Resolves: tdf#86159 floating windows have complicated borders
take the border window dimensions into account on the
layout size, but not the layout position
Change-Id: I9deb722933e325c92e93ae917fa8e34eaccfca2d
diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx
index d017b21..c9e03b4 100644
--- a/include/vcl/floatwin.hxx
+++ b/include/vcl/floatwin.hxx
@@ -94,6 +94,7 @@ private:
SAL_DLLPRIVATE void ImplCallPopupModeEnd();
DECL_DLLPRIVATE_LINK( ImplEndPopupModeHdl, void* );
virtual void setPosSizeOnContainee(Size aSize, Window &rBox);
FloatingWindow (const FloatingWindow &) SAL_DELETED_FUNCTION;
FloatingWindow & operator= (const FloatingWindow &) SAL_DELETED_FUNCTION;
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index 1f29d45..2773fa6 100644
--- a/include/vcl/syswin.hxx
+++ b/include/vcl/syswin.hxx
@@ -158,7 +158,7 @@ public:
private:
SAL_DLLPRIVATE void Init();
SAL_DLLPRIVATE void ImplMoveToScreen( long& io_rX, long& io_rY, long i_nWidth, long i_nHeight, vcl::Window* i_pConfigureWin );
SAL_DLLPRIVATE void setPosSizeOnContainee(Size aSize, Window &rBox);
virtual void setPosSizeOnContainee(Size aSize, Window &rBox);
DECL_DLLPRIVATE_LINK( ImplHandleLayoutTimerHdl, void* );
protected:
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index f7089c1..e22ec5d 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -22,6 +22,7 @@
#include <window.h>
#include <salframe.hxx>
#include <vcl/layout.hxx>
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/event.hxx>
@@ -807,4 +808,15 @@ void FloatingWindow::AddPopupModeWindow( vcl::Window* pWindow )
mpFirstPopupModeWin = pWindow;
}
void FloatingWindow::setPosSizeOnContainee(Size aSize, Window &rBox)
{
sal_Int32 nBorderWidth = get_border_width();
aSize.Width() -= mpWindowImpl->mnLeftBorder + mpWindowImpl->mnRightBorder + 2 * nBorderWidth;
aSize.Height() -= nBorderWidth + mpWindowImpl->mnTopBorder + mpWindowImpl->mnBottomBorder + 2 * nBorderWidth;
Point aPos(nBorderWidth, nBorderWidth);
VclContainer::setLayoutAllocation(rBox, aPos, aSize);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */