From 12dbc2d235e7ff6ef118b53c709dcde9d4c4f983 Mon Sep 17 00:00:00 2001 From: Agnelo Vaz Date: Thu, 12 Mar 2015 11:06:42 +0000 Subject: [PATCH] Reduce Popup layers, parent to same actor as other decorations Change-Id: Ie333ecbdb9a110d817d3029ccab6da0cf352eaa6 Signed-off-by: Agnelo Vaz --- .../internal/text/decorator/text-decorator.cpp | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/dali-toolkit/internal/text/decorator/text-decorator.cpp b/dali-toolkit/internal/text/decorator/text-decorator.cpp index df66c5f..4df7c51 100644 --- a/dali-toolkit/internal/text/decorator/text-decorator.cpp +++ b/dali-toolkit/internal/text/decorator/text-decorator.cpp @@ -228,8 +228,9 @@ struct Decorator::Impl : public ConnectionTracker { } - Layer mRoot; // The actor which all popup content is added to (i.e. panel and buttons) - Actor mButtons; // Actor which holds all the buttons, sensitivity can be set on all buttons via this actor + Actor mRoot; // The actor which all popup content is added to (i.e. panel and buttons) + Actor mButtons; // Actor which holds all the buttons, sensitivity can be set oActor buttons via this actor + Layer mStencilLayer; // Layer to enable clipping when buttons exceed popup ImageActor mBackground; // The background popup panel ImageActor mTail; // The tail for the popup ImageActor mTailEffect; // the tail effect @@ -340,7 +341,6 @@ struct Decorator::Impl : public ConnectionTracker if ( mActiveCopyPastePopup ) { CreatePopup(); - mCopyPastePopup.mRoot.SetPosition( Vector3( 180.0f, -100.0f, 0.0f ) ); //todo grabhandle or selection handle postions to be used } else @@ -787,32 +787,32 @@ struct Decorator::Impl : public ConnectionTracker } } - void SetUpPopup( Actor& parent, Size& size ) + void SetUpPopup( Actor& popupRootActor, Size& size ) { // Create Layer and Stencil. - parent = Layer::New(); - Layer layer = Layer::New(); + popupRootActor = Actor::New(); + mCopyPastePopup.mStencilLayer = Layer::New(); ImageActor stencil = CreateSolidColorActor( Color::RED ); stencil.SetDrawMode( DrawMode::STENCIL ); stencil.SetVisible( true ); Actor scrollview = Actor::New(); //todo Use Size negotiation - layer.SetSize( size ); // matches stencil size - parent.SetSize( size ); // matches stencil size + mCopyPastePopup.mStencilLayer.SetSize( size ); // matches stencil size + popupRootActor.SetSize( size ); // matches stencil size stencil.SetSize( size ); scrollview.SetSize( size ); mCopyPastePopup.mButtons.SetSize( size ); - layer.SetAnchorPoint(AnchorPoint::TOP_LEFT); + mCopyPastePopup.mStencilLayer.SetAnchorPoint(AnchorPoint::TOP_LEFT); scrollview.SetAnchorPoint(AnchorPoint::TOP_LEFT); - //mCopyPastePopup.mBackground.SetAnchorPoint(AnchorPoint::TOP_LEFT); mCopyPastePopup.mButtons.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - parent.Add( mCopyPastePopup.mBackground ); - parent.Add( layer ); - layer.Add( stencil ); - layer.Add( scrollview ); + mActiveLayer.Add( mCopyPastePopup.mRoot ); + popupRootActor.Add( mCopyPastePopup.mBackground ); + popupRootActor.Add( mCopyPastePopup.mStencilLayer ); + mCopyPastePopup.mStencilLayer.Add( stencil ); + mCopyPastePopup.mStencilLayer.Add( scrollview ); scrollview.Add( mCopyPastePopup.mButtons ); } @@ -873,9 +873,9 @@ struct Decorator::Impl : public ConnectionTracker CreateBackground( mCopyPastePopup ); AddPopupOptions( true, true ); SetUpPopup( mCopyPastePopup.mRoot, mCopyPastePopup.mVisiblePopUpSize ); - Actor textControl = mTextControlParent.Self(); - textControl.Add( mCopyPastePopup.mRoot ); } + + mCopyPastePopup.mStencilLayer.RaiseToTop(); } void DestroyPopup() -- 2.7.4