include/vcl/dockwin.hxx | 3 ++- sfx2/source/sidebar/SidebarDockingWindow.cxx | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-)
New commits: commit af1c5b959462bc7dcd675c6298ca69c69f33bd52 Author: Katarina Behrens <katarina.behr...@cib.de> Date: Tue Mar 20 15:31:21 2018 +0100 Enable undocking of sidebar by dragging a deck grip Change-Id: I59d15b4c61045bfd97dd937e6f383652db33fd8f Reviewed-on: https://gerrit.libreoffice.org/53496 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Katarina Behrens <katarina.behr...@cib.de> diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx index 905500e8e908..a4f99a7e2ffa 100644 --- a/include/vcl/dockwin.hxx +++ b/include/vcl/dockwin.hxx @@ -270,7 +270,8 @@ public: bool isLayoutEnabled() const; void setOptimalLayoutSize(); - SAL_DLLPRIVATE void ImplStartDocking( const Point& rPos ); + //FIXME: is it okay to make this public? + void ImplStartDocking( const Point& rPos ); SAL_DLLPRIVATE bool isDeferredInit() const { return mbIsDeferredInit; } virtual void doDeferredInit(WinBits nBits); protected: diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx index 11ebe7614e0a..e241ab6cbb8e 100644 --- a/sfx2/source/sidebar/SidebarDockingWindow.cxx +++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx @@ -117,7 +117,7 @@ bool SidebarDockingWindow::EventNotify(NotifyEvent& rEvent) if (MouseNotifyEvent::KEYINPUT == nType) return true; - if ( MouseNotifyEvent::MOUSEBUTTONDOWN == nType) + if (MouseNotifyEvent::MOUSEBUTTONDOWN == nType) { const MouseEvent *mEvt = rEvent.GetMouseEvent(); if (mEvt->IsLeft()) @@ -127,6 +127,22 @@ bool SidebarDockingWindow::EventNotify(NotifyEvent& rEvent) SetReadyToDrag( true ); } } + else if (MouseNotifyEvent::MOUSEMOVE == nType) + { + const MouseEvent *mEvt = rEvent.GetMouseEvent(); + tools::Rectangle aGrip = mpSidebarController->GetDeckDragArea(); + if (mEvt->IsLeft() && aGrip.IsInside( mEvt->GetPosPixel() ) && IsReadyToDrag() ) + { + Point aPos = mEvt->GetPosPixel(); + vcl::Window* pWindow = rEvent.GetWindow(); + if ( pWindow != this ) + { + aPos = pWindow->OutputToScreenPixel( aPos ); + aPos = ScreenToOutputPixel( aPos ); + } + ImplStartDocking( aPos ); + } + } return SfxDockingWindow::EventNotify(rEvent); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits