summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-02-13 16:42:19 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-02-13 16:48:01 +0000
commitd1f38b47c29ef5e2db2cabeb657668637d97e13d (patch)
tree146df41ebb9fcbd37fd76bf0a83d74d7e8e1a94d
parente4882717f3dc0375e113ed692374870ab8302a16 (diff)
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
-rw-r--r--include/vcl/floatwin.hxx1
-rw-r--r--include/vcl/syswin.hxx2
-rw-r--r--vcl/source/window/floatwin.cxx12
3 files changed, 14 insertions, 1 deletions
diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx
index d017b218901e..c9e03b4a5c2f 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 1f29d45f0613..2773fa66ff7e 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 f7089c162dda..e22ec5dc7a94 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: */