diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-08-03 14:42:55 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2017-10-02 11:01:18 +0530 |
commit | 9cdaccc0cc5664ffb22035f65135b6be876de92f (patch) | |
tree | db1a7c5ff2d08c90c3cb0c6ae94ff870783b49e5 /vcl/source/window/floatwin.cxx | |
parent | 44737be728c1d1afa23631e7576569ddf2d3016c (diff) |
lokdialog: Support for rendering floating window dialog widgets
Now gtktiledviewer can show floating window dialog widgets when user
clicks any of such widget in the dialog.
Change-Id: I13d756f236379bc8b2041ed41cb7b502f7fd9b24
Diffstat (limited to 'vcl/source/window/floatwin.cxx')
-rw-r--r-- | vcl/source/window/floatwin.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 23e56ce6e669..16bcb721a612 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -38,6 +38,7 @@ public: VclPtr<ToolBox> mpBox; tools::Rectangle maItemEdgeClipRect; // used to clip the common edge between a toolbar item and the border of this window + Point maPos; // position of the floating window wrt. parent }; FloatingWindow::ImplData::ImplData() @@ -592,6 +593,15 @@ void FloatingWindow::StateChanged( StateChangedType nType ) } SystemWindow::StateChanged( nType ); + Dialog* pParentDlg = GetParentDialog(); + if (pParentDlg && nType == StateChangedType::InitShow && IsVisible()) + { + pParentDlg->InvalidateFloatingWindow(mpImplData->maPos); + } + else if (pParentDlg && !IsVisible()) + { + pParentDlg->CloseFloatingWindow(); + } if ( nType == StateChangedType::ControlBackground ) { @@ -667,8 +677,8 @@ void FloatingWindow::StartPopupMode( const tools::Rectangle& rRect, FloatWinPopu // compute window position according to flags and arrangement sal_uInt16 nArrangeIndex; - Point aPos = ImplCalcPos( this, rRect, nFlags, nArrangeIndex ); - SetPosPixel( aPos ); + mpImplData->maPos = ImplCalcPos( this, rRect, nFlags, nArrangeIndex ); + SetPosPixel( mpImplData->maPos ); // set data and display window // convert maFloatRect to absolute device coordinates @@ -714,10 +724,10 @@ void FloatingWindow::StartPopupMode( ToolBox* pBox, FloatWinPopupFlags nFlags ) // retrieve some data from the ToolBox tools::Rectangle aRect = nItemId ? pBox->GetItemRect( nItemId ) : pBox->GetOverflowRect(); - Point aPos; + // convert to parent's screen coordinates - aPos = GetParent()->OutputToScreenPixel( GetParent()->AbsoluteScreenToOutputPixel( pBox->OutputToAbsoluteScreenPixel( aRect.TopLeft() ) ) ); - aRect.SetPos( aPos ); + mpImplData->maPos = GetParent()->OutputToScreenPixel( GetParent()->AbsoluteScreenToOutputPixel( pBox->OutputToAbsoluteScreenPixel( aRect.TopLeft() ) ) ); + aRect.SetPos( mpImplData->maPos ); nFlags |= FloatWinPopupFlags::AllMouseButtonClose | |