if( mActiveCopyPastePopup )
{
- if( !mCopyPastePopup.actor.GetParent() )
- {
- mActiveLayer.Add( mCopyPastePopup.actor );
- }
-
- mCopyPastePopup.actor.RaiseAbove( mActiveLayer );
+ ShowPopup();
}
else
{
if( mCopyPastePopup.actor )
{
- mCopyPastePopup.actor.Unparent();
+ mCopyPastePopup.actor.HidePopup();
}
}
}
DeterminePositionPopup();
}
+ void ShowPopup()
+ {
+ if ( !mCopyPastePopup.actor )
+ {
+ return;
+ }
+
+ if( !mCopyPastePopup.actor.GetParent() )
+ {
+ mActiveLayer.Add( mCopyPastePopup.actor );
+ }
+
+ mCopyPastePopup.actor.RaiseAbove( mActiveLayer );
+ mCopyPastePopup.actor.ShowPopup();
+ }
+
void DeterminePositionPopup()
{
if ( !mActiveCopyPastePopup )
void PopupRelayoutComplete( Actor actor )
{
// Size negotiation for CopyPastePopup complete so can get the size and constrain position within bounding box.
- mCopyPastePopup.actor.OnRelayoutSignal().Disconnect( this, &Decorator::Impl::PopupRelayoutComplete );
DeterminePositionPopup();
}
{
mImpl->mEnabledPopupButtons = enabledButtonsBitMask;
- UnparentAndReset( mImpl->mCopyPastePopup.actor );
- mImpl->mCopyPastePopup.actor = TextSelectionPopup::New( mImpl->mEnabledPopupButtons,
- &mImpl->mTextSelectionPopupCallbackInterface );
+ if ( !mImpl->mCopyPastePopup.actor )
+ {
+ mImpl->mCopyPastePopup.actor = TextSelectionPopup::New( &mImpl->mTextSelectionPopupCallbackInterface );
#ifdef DECORATOR_DEBUG
- mImpl->mCopyPastePopup.actor.SetName("mCopyPastePopup");
+ mImpl->mCopyPastePopup.actor.SetName("mCopyPastePopup");
#endif
- mImpl->mCopyPastePopup.actor.SetAnchorPoint( AnchorPoint::CENTER );
- mImpl->mCopyPastePopup.actor.OnRelayoutSignal().Connect( mImpl, &Decorator::Impl::PopupRelayoutComplete ); // Position popup after size negotiation
-
- if( mImpl->mActiveLayer )
- {
- mImpl->mActiveLayer.Add( mImpl->mCopyPastePopup.actor );
- mImpl->mCopyPastePopup.actor.ShowPopup();
+ mImpl->mCopyPastePopup.actor.SetAnchorPoint( AnchorPoint::CENTER );
+ mImpl->mCopyPastePopup.actor.OnRelayoutSignal().Connect( mImpl, &Decorator::Impl::PopupRelayoutComplete ); // Position popup after size negotiation
}
+
+ mImpl->mCopyPastePopup.actor.EnableButtons( mImpl->mEnabledPopupButtons );
}
TextSelectionPopup::Buttons& Decorator::GetEnabledPopupButtons()