diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2017-09-18 09:57:39 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-09-24 15:37:27 +0300 |
commit | 8f1e01fc89ca5d5f03d172f038e2310ba2ac5580 (patch) | |
tree | 7897b77ca953c63365b3508538a4723ad45485e6 | |
parent | ad769c30d2a709786a769f75fa5e04b33edf0809 (diff) |
Support non-ToolBox popup case in DockingManager, tdf#106762 prep
Change-Id: I54d4de28336b70dbd07923377e6cceb67079fa80
-rw-r--r-- | include/vcl/dockwin.hxx | 3 | ||||
-rw-r--r-- | vcl/source/window/dockmgr.cxx | 33 |
2 files changed, 31 insertions, 5 deletions
diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx index 723aef49d4a6..00e8f58d87fa 100644 --- a/include/vcl/dockwin.hxx +++ b/include/vcl/dockwin.hxx @@ -111,6 +111,7 @@ private: DECL_LINK( PopupModeEnd, FloatingWindow*, void ); void ImplEnableStartDocking() { mbStartDockingEnabled = true; } bool ImplStartDockingEnabled() { return mbStartDockingEnabled; } + void ImplPreparePopupMode( FloatWinPopupFlags nFlags ); public: ImplDockingWindowWrapper( const vcl::Window *pWindow ); @@ -133,6 +134,7 @@ public: void Unlock(); bool IsLocked() const { return mbLocked;} + void StartPopupMode( const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags ); void StartPopupMode( ToolBox* pParentToolBox, FloatWinPopupFlags nPopupModeFlags ); bool IsInPopupMode() const; @@ -187,6 +189,7 @@ public: void Unlock( const vcl::Window *pWin ); bool IsLocked( const vcl::Window *pWin ); + void StartPopupMode( const vcl::Window *pWin, const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags ); void StartPopupMode( ToolBox *pParentToolBox, const vcl::Window *pWin ); void StartPopupMode( ToolBox *pParentToolBox, const vcl::Window *pWin, FloatWinPopupFlags nPopupModeFlags ); diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index bc3eb2cc5b42..67569f773ee4 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -332,6 +332,13 @@ void DockingManager::SetFloatingMode( const vcl::Window *pWindow, bool bFloating pWrapper->SetFloatingMode( bFloating ); } +void DockingManager::StartPopupMode( const vcl::Window *pWindow, const tools::Rectangle& rRect, FloatWinPopupFlags nFlags ) +{ + ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow ); + if( pWrapper ) + pWrapper->StartPopupMode( rRect, nFlags ); +} + void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const vcl::Window *pWindow, FloatWinPopupFlags nFlags ) { ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow ); @@ -915,12 +922,8 @@ void ImplDockingWindowWrapper::ShowTitleButton( TitleButton nButton, bool bVisib } } -void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWinPopupFlags nFlags ) +void ImplDockingWindowWrapper::ImplPreparePopupMode( FloatWinPopupFlags nFlags ) { - // do nothing if window is floating - if( IsFloatingMode() ) - return; - GetWindow()->Show( false, ShowFlags::NoFocusChange ); // prepare reparenting @@ -966,6 +969,15 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin // set mpFloatWin not until all window positioning is done !!! // (SetPosPixel etc. check for valid mpFloatWin pointer) mpFloatWin = pWin; +} + +void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWinPopupFlags nFlags ) +{ + // do nothing if window is floating + if( IsFloatingMode() ) + return; + + ImplPreparePopupMode( nFlags ); // if the subtoolbar was opened via keyboard make sure that key events // will go into subtoolbar @@ -983,6 +995,17 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin } } +void ImplDockingWindowWrapper::StartPopupMode( const tools::Rectangle& rRect, FloatWinPopupFlags nFlags ) +{ + // do nothing if window is floating + if( IsFloatingMode() ) + return; + + ImplPreparePopupMode( nFlags ); + mpFloatWin->StartPopupMode( rRect, nFlags ); + GetWindow()->Show(); +} + IMPL_LINK_NOARG(ImplDockingWindowWrapper, PopupModeEnd, FloatingWindow*, void) { GetWindow()->Show( false, ShowFlags::NoFocusChange ); |