diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-03-20 15:31:21 +0100 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-04-28 18:31:30 +0200 |
commit | af1c5b959462bc7dcd675c6298ca69c69f33bd52 (patch) | |
tree | 8dad8f76f5327e0d62640fb85954790bff63cd04 /sfx2 | |
parent | b0eca89b921e0e57a9c4982aa3ffdfba8bd79bc4 (diff) |
Enable undocking of sidebar by dragging a deck grip
Change-Id: I59d15b4c61045bfd97dd937e6f383652db33fd8f
Reviewed-on: https://gerrit.libreoffice.org/53496
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/SidebarDockingWindow.cxx | 18 |
1 files changed, 17 insertions, 1 deletions
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); } |