Corrected popup position in text decorator when grab handle is active
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / decorator / text-decorator.cpp
index 757eb4e..ff03ac9 100644 (file)
@@ -33,8 +33,9 @@
 #include <dali/devel-api/rendering/renderer.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control-depth-index-ranges.h>
-#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
+#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
+#include <dali-toolkit/internal/controls/image-view/image-view-impl.h>
 
 #ifdef DEBUG_ENABLED
 #define DECORATOR_DEBUG
@@ -220,9 +221,9 @@ struct Decorator::Impl : public ConnectionTracker
     {
     }
 
-    ImageActor actor;
+    ImageView actor;
     Actor grabArea;
-    ImageActor markerActor;
+    ImageView markerActor;
 
     Vector2 position;
     Size    size;
@@ -282,9 +283,7 @@ struct Decorator::Impl : public ConnectionTracker
     mNotifyEndOfScroll( false )
   {
     mQuadVertexFormat[ "aPosition" ] = Property::VECTOR2;
-    mQuadIndexFormat[ "indices" ] = Property::INTEGER;
-    mHighlightMaterial = Material::New( Shader::New( VERTEX_SHADER, FRAGMENT_SHADER ) );
-
+    mHighlightShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
     SetupTouchEvents();
   }
 
@@ -487,7 +486,6 @@ struct Decorator::Impl : public ConnectionTracker
     {
       const HandleImpl& primaryHandle = mHandle[LEFT_SELECTION_HANDLE];
       const HandleImpl& secondaryHandle = mHandle[RIGHT_SELECTION_HANDLE];
-      const HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
       const CursorImpl& cursor = mCursor[PRIMARY_CURSOR];
 
       if( primaryHandle.active || secondaryHandle.active )
@@ -503,7 +501,15 @@ struct Decorator::Impl : public ConnectionTracker
       else
       {
         // Calculates the popup's position if the grab handle is active.
-        mCopyPastePopup.position = Vector3( cursor.position.x, -0.5f * popupSize.height - grabHandle.size.height + cursor.position.y, 0.0f );
+        const HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
+        if( grabHandle.verticallyFlipped )
+        {
+          mCopyPastePopup.position = Vector3( cursor.position.x, -0.5f * popupSize.height - grabHandle.size.height + cursor.position.y, 0.0f );
+        }
+        else
+        {
+          mCopyPastePopup.position = Vector3( cursor.position.x, -0.5f * popupSize.height + cursor.position.y, 0.0f );
+        }
       }
     }
 
@@ -523,11 +529,11 @@ struct Decorator::Impl : public ConnectionTracker
     DeterminePositionPopup();
   }
 
-  void CreateCursor( ImageActor& cursor, const Vector4& color )
+  void CreateCursor( Control& cursor, const Vector4& color )
   {
-    cursor = CreateSolidColorActor( color );
-    cursor.SetSortModifier( DECORATION_DEPTH_INDEX );
-    cursor.SetParentOrigin( ParentOrigin::TOP_LEFT ); // Need to set the default parent origin as CreateSolidColorActor() sets a different one.
+    cursor = Control::New();
+    cursor.SetBackgroundColor( color );
+    cursor.SetParentOrigin( ParentOrigin::TOP_LEFT );
     cursor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   }
 
@@ -635,7 +641,6 @@ struct Decorator::Impl : public ConnectionTracker
 
       mActiveLayer.SetParentOrigin( ParentOrigin::CENTER );
       mActiveLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      mActiveLayer.SetPositionInheritanceMode( USE_PARENT_POSITION );
 
       // Add the active layer telling the controller it doesn't need clipping.
       mController.AddDecoration( mActiveLayer, false );
@@ -657,41 +662,47 @@ struct Decorator::Impl : public ConnectionTracker
     HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
     if( !grabHandle.actor )
     {
-      grabHandle.actor = ImageActor::New( mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] );
-      grabHandle.actor.SetSortModifier( DECORATION_DEPTH_INDEX );
-      grabHandle.actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-      // Area that Grab handle responds to, larger than actual handle so easier to move
-#ifdef DECORATOR_DEBUG
-      grabHandle.actor.SetName( "GrabHandleActor" );
-      if ( Dali::Internal::gLogFilter->IsEnabledFor( Debug::Verbose ) )
+      if( mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] )
       {
-        grabHandle.grabArea = Toolkit::CreateSolidColorActor( Vector4(0.0f, 0.0f, 0.0f, 0.0f), true, Color::RED, 1 );
-        grabHandle.grabArea.SetName( "GrabArea" );
-      }
-      else
-      {
-        grabHandle.grabArea = Actor::New();
-        grabHandle.grabArea.SetName( "GrabArea" );
-      }
+        grabHandle.actor = ImageView::New( mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] );
+        GetImpl( grabHandle.actor).SetDepthIndex( DepthIndex::DECORATION );
+        grabHandle.actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+
+        // Area that Grab handle responds to, larger than actual handle so easier to move
+#ifdef DECORATOR_DEBUG
+        grabHandle.actor.SetName( "GrabHandleActor" );
+        if ( Dali::Internal::gLogFilter->IsEnabledFor( Debug::Verbose ) )
+        {
+          grabHandle.grabArea = Control::New();
+          Toolkit::Control control = Toolkit::Control::DownCast( grabHandle.grabArea );
+          control.SetBackgroundColor( Vector4( 1.0f, 1.0f, 1.0f, 0.5f ) );
+          grabHandle.grabArea.SetName( "GrabArea" );
+        }
+        else
+        {
+          grabHandle.grabArea = Actor::New();
+          grabHandle.grabArea.SetName( "GrabArea" );
+        }
 #else
-      grabHandle.grabArea = Actor::New();
+        grabHandle.grabArea = Actor::New();
 #endif
 
-      grabHandle.grabArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
-      grabHandle.grabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-      grabHandle.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      grabHandle.grabArea.SetSizeModeFactor( DEFAULT_GRAB_HANDLE_RELATIVE_SIZE );
-      grabHandle.actor.Add( grabHandle.grabArea );
-      grabHandle.actor.SetColor( mHandleColor );
+        grabHandle.grabArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
+        grabHandle.grabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+        grabHandle.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+        grabHandle.grabArea.SetSizeModeFactor( DEFAULT_GRAB_HANDLE_RELATIVE_SIZE );
+        grabHandle.actor.Add( grabHandle.grabArea );
+        grabHandle.actor.SetColor( mHandleColor );
 
-      grabHandle.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnGrabHandleTouched );
-      mTapDetector.Attach( grabHandle.grabArea );
-      mPanGestureDetector.Attach( grabHandle.grabArea );
+        grabHandle.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnGrabHandleTouched );
+        mTapDetector.Attach( grabHandle.grabArea );
+        mPanGestureDetector.Attach( grabHandle.grabArea );
 
-      mActiveLayer.Add( grabHandle.actor );
+        mActiveLayer.Add( grabHandle.actor );
+      }
     }
 
-    if( !grabHandle.actor.GetParent() )
+    if( grabHandle.actor && !grabHandle.actor.GetParent() )
     {
       mActiveLayer.Add( grabHandle.actor );
     }
@@ -701,7 +712,7 @@ struct Decorator::Impl : public ConnectionTracker
   {
     if( image )
     {
-      handle.markerActor = ImageActor::New( image );
+      handle.markerActor = ImageView::New( image );
       handle.markerActor.SetColor( mHandleColor );
       handle.actor.Add( handle.markerActor );
 
@@ -725,33 +736,36 @@ struct Decorator::Impl : public ConnectionTracker
     HandleImpl& primary = mHandle[ LEFT_SELECTION_HANDLE ];
     if( !primary.actor )
     {
-      primary.actor = ImageActor::New( mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] );
+      if( mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] )
+      {
+        primary.actor = ImageView::New( mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] );
 #ifdef DECORATOR_DEBUG
-      primary.actor.SetName("SelectionHandleOne");
+        primary.actor.SetName("SelectionHandleOne");
 #endif
-      primary.actor.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); // Change to BOTTOM_RIGHT if Look'n'Feel requires handle above text.
-      primary.actor.SetSortModifier( DECORATION_DEPTH_INDEX );
-      primary.actor.SetColor( mHandleColor );
+        primary.actor.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); // Change to BOTTOM_RIGHT if Look'n'Feel requires handle above text.
+        GetImpl( primary.actor ).SetDepthIndex( DepthIndex::DECORATION );
+        primary.actor.SetColor( mHandleColor );
 
-      primary.grabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
+        primary.grabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
 #ifdef DECORATOR_DEBUG
-      primary.grabArea.SetName("SelectionHandleOneGrabArea");
+        primary.grabArea.SetName("SelectionHandleOneGrabArea");
 #endif
-      primary.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      primary.grabArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
-      primary.grabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-      primary.grabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
+        primary.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+        primary.grabArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
+        primary.grabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+        primary.grabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
 
-      mTapDetector.Attach( primary.grabArea );
-      mPanGestureDetector.Attach( primary.grabArea );
-      primary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleOneTouched );
+        mTapDetector.Attach( primary.grabArea );
+        mPanGestureDetector.Attach( primary.grabArea );
+        primary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleOneTouched );
 
-      primary.actor.Add( primary.grabArea );
+        primary.actor.Add( primary.grabArea );
 
-      CreateHandleMarker( primary, mHandleImages[LEFT_SELECTION_HANDLE_MARKER][HANDLE_IMAGE_RELEASED], LEFT_SELECTION_HANDLE );
+        CreateHandleMarker( primary, mHandleImages[LEFT_SELECTION_HANDLE_MARKER][HANDLE_IMAGE_RELEASED], LEFT_SELECTION_HANDLE );
+      }
     }
 
-    if( !primary.actor.GetParent() )
+    if( primary.actor && !primary.actor.GetParent() )
     {
       mActiveLayer.Add( primary.actor );
     }
@@ -759,33 +773,36 @@ struct Decorator::Impl : public ConnectionTracker
     HandleImpl& secondary = mHandle[ RIGHT_SELECTION_HANDLE ];
     if( !secondary.actor )
     {
-      secondary.actor = ImageActor::New( mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] );
+      if( mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] )
+      {
+        secondary.actor = ImageView::New( mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] );
 #ifdef DECORATOR_DEBUG
-      secondary.actor.SetName("SelectionHandleTwo");
+        secondary.actor.SetName("SelectionHandleTwo");
 #endif
-      secondary.actor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); // Change to BOTTOM_LEFT if Look'n'Feel requires handle above text.
-      secondary.actor.SetSortModifier( DECORATION_DEPTH_INDEX );
-      secondary.actor.SetColor( mHandleColor );
+        secondary.actor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); // Change to BOTTOM_LEFT if Look'n'Feel requires handle above text.
+        GetImpl( secondary.actor ).SetDepthIndex( DepthIndex::DECORATION );
+        secondary.actor.SetColor( mHandleColor );
 
-      secondary.grabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
+        secondary.grabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
 #ifdef DECORATOR_DEBUG
-      secondary.grabArea.SetName("SelectionHandleTwoGrabArea");
+        secondary.grabArea.SetName("SelectionHandleTwoGrabArea");
 #endif
-      secondary.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      secondary.grabArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
-      secondary.grabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-      secondary.grabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
+        secondary.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+        secondary.grabArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
+        secondary.grabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+        secondary.grabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
 
-      mTapDetector.Attach( secondary.grabArea );
-      mPanGestureDetector.Attach( secondary.grabArea );
-      secondary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleTwoTouched );
+        mTapDetector.Attach( secondary.grabArea );
+        mPanGestureDetector.Attach( secondary.grabArea );
+        secondary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleTwoTouched );
 
-      secondary.actor.Add( secondary.grabArea );
+        secondary.actor.Add( secondary.grabArea );
 
-      CreateHandleMarker( secondary, mHandleImages[RIGHT_SELECTION_HANDLE_MARKER][HANDLE_IMAGE_RELEASED], RIGHT_SELECTION_HANDLE  );
+        CreateHandleMarker( secondary, mHandleImages[RIGHT_SELECTION_HANDLE_MARKER][HANDLE_IMAGE_RELEASED], RIGHT_SELECTION_HANDLE  );
+      }
     }
 
-    if( !secondary.actor.GetParent() )
+    if( secondary.actor && !secondary.actor.GetParent() )
     {
       mActiveLayer.Add( secondary.actor );
     }
@@ -830,8 +847,11 @@ struct Decorator::Impl : public ConnectionTracker
     // The SetGrabHandleImage() method will change the orientation.
     const float yLocalPosition = grabHandle.verticallyFlipped ? grabHandle.position.y : grabHandle.position.y + grabHandle.lineHeight;
 
-    grabHandle.actor.SetPosition( grabHandle.position.x + floor( 0.5f * mCursorWidth ),
-                                  yLocalPosition ); // TODO : Fix for multiline.
+    if( grabHandle.actor )
+    {
+      grabHandle.actor.SetPosition( grabHandle.position.x + floor( 0.5f * mCursorWidth ),
+                                    yLocalPosition ); // TODO : Fix for multiline.
+    }
   }
 
   void SetSelectionHandlePosition( HandleType type )
@@ -887,7 +907,7 @@ struct Decorator::Impl : public ConnectionTracker
 
     if( flipHandle )
     {
-      if( !handle.horizontallyFlipped )
+      if( handle.actor && !handle.horizontallyFlipped )
       {
         // Change the anchor point to flip the image.
         handle.actor.SetAnchorPoint( isPrimaryHandle ? AnchorPoint::TOP_LEFT : AnchorPoint::TOP_RIGHT );
@@ -897,7 +917,7 @@ struct Decorator::Impl : public ConnectionTracker
     }
     else
     {
-      if( handle.horizontallyFlipped )
+      if( handle.actor && handle.horizontallyFlipped )
       {
         // Reset the anchor point.
         handle.actor.SetAnchorPoint( isPrimaryHandle ? AnchorPoint::TOP_RIGHT : AnchorPoint::TOP_LEFT );
@@ -917,8 +937,11 @@ struct Decorator::Impl : public ConnectionTracker
     // The SetHandleImage() method will change the orientation.
     const float yLocalPosition = handle.verticallyFlipped ? handle.position.y : handle.position.y + handle.lineHeight;
 
-    handle.actor.SetPosition( handle.position.x,
-                              yLocalPosition ); // TODO : Fix for multiline.
+    if( handle.actor )
+    {
+      handle.actor.SetPosition( handle.position.x,
+                                yLocalPosition ); // TODO : Fix for multiline.
+    }
   }
 
   void SetHandleImage( HandleType type )
@@ -988,7 +1011,7 @@ struct Decorator::Impl : public ConnectionTracker
       if( !mHighlightQuadList.empty() )
       {
         Vector< Vector2 > vertices;
-        Vector< unsigned int> indices;
+        Vector< unsigned short> indices;
         Vector2 vertex;
 
         std::vector<QuadCoordinates>::iterator iter = mHighlightQuadList.begin();
@@ -1029,37 +1052,23 @@ struct Decorator::Impl : public ConnectionTracker
           indices.PushBack( v + 3 );
         }
 
-        if( mQuadVertices )
+        if( mQuadVertices )
         {
-          mQuadVertices.SetSize( vertices.Size() );
-        }
-        else
-        {
-          mQuadVertices = PropertyBuffer::New( mQuadVertexFormat, vertices.Size() );
-        }
-
-        if( mQuadIndices )
-        {
-          mQuadIndices.SetSize( indices.Size() );
-        }
-        else
-        {
-          mQuadIndices = PropertyBuffer::New( mQuadIndexFormat, indices.Size() );
+          mQuadVertices = PropertyBuffer::New( mQuadVertexFormat );
         }
 
-        mQuadVertices.SetData( &vertices[ 0 ] );
-        mQuadIndices.SetData( &indices[ 0 ] );
+        mQuadVertices.SetData( &vertices[ 0 ], vertices.Size() );
 
         if( !mQuadGeometry )
         {
           mQuadGeometry = Geometry::New();
           mQuadGeometry.AddVertexBuffer( mQuadVertices );
         }
-        mQuadGeometry.SetIndexBuffer( mQuadIndices );
+        mQuadGeometry.SetIndexBuffer( &indices[ 0 ], indices.Size() );
 
         if( !mHighlightRenderer )
         {
-          mHighlightRenderer = Dali::Renderer::New( mQuadGeometry, mHighlightMaterial );
+          mHighlightRenderer = Dali::Renderer::New( mQuadGeometry, mHighlightShader );
           mHighlightActor.AddRenderer( mHighlightRenderer );
         }
       }
@@ -1071,7 +1080,7 @@ struct Decorator::Impl : public ConnectionTracker
 
       if( mHighlightRenderer )
       {
-        mHighlightRenderer.SetDepthIndex( mTextDepth - 2u ); // text is rendered at mTextDepth and text's shadow at mTextDepth -1u.
+        mHighlightRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, mTextDepth - 2 ); // text is rendered at mTextDepth and text's shadow at mTextDepth -1u.
       }
     }
   }
@@ -1088,11 +1097,11 @@ struct Decorator::Impl : public ConnectionTracker
   {
     if( Gesture::Started == gesture.state )
     {
-      handle.grabDisplacementX = handle.grabDisplacementY = 0;
+      handle.grabDisplacementX = handle.grabDisplacementY = 0.f;
     }
 
     handle.grabDisplacementX += gesture.displacement.x;
-    handle.grabDisplacementY += gesture.displacement.y;
+    handle.grabDisplacementY += ( handle.verticallyFlipped ? -gesture.displacement.y : gesture.displacement.y );
 
     const float x = handle.position.x + handle.grabDisplacementX;
     const float y = handle.position.y + handle.lineHeight*0.5f + handle.grabDisplacementY;
@@ -1140,7 +1149,10 @@ struct Decorator::Impl : public ConnectionTracker
         mController.DecorationEvent( type, HANDLE_RELEASED, x, y );
       }
 
-      handle.actor.SetImage( mHandleImages[type][HANDLE_IMAGE_RELEASED] );
+      if( handle.actor )
+      {
+        handle.actor.SetImage( mHandleImages[type][HANDLE_IMAGE_RELEASED] );
+      }
       handle.pressed = false;
 
       mHandlePanning = false;
@@ -1635,14 +1647,13 @@ struct Decorator::Impl : public ConnectionTracker
   PropertyNotification mVerticalGreaterThanNotification;   ///< Notifies when the 'y' coord of the active layer is grater than a given value.
   PropertyNotification mHorizontalLessThanNotification;    ///< Notifies when the 'x' coord of the active layer is less than a given value.
   PropertyNotification mHorizontalGreaterThanNotification; ///< Notifies when the 'x' coord of the active layer is grater than a given value.
-  ImageActor           mPrimaryCursor;
-  ImageActor           mSecondaryCursor;
+  Control              mPrimaryCursor;
+  Control              mSecondaryCursor;
 
   Actor               mHighlightActor;            ///< Actor to display highlight
   Renderer            mHighlightRenderer;
-  Material            mHighlightMaterial;         ///< Material used for highlight
+  Shader              mHighlightShader;           ///< Shader used for highlight
   Property::Map       mQuadVertexFormat;
-  Property::Map       mQuadIndexFormat;
   PopupImpl           mCopyPastePopup;
   TextSelectionPopup::Buttons mEnabledPopupButtons; /// Bit mask of currently enabled Popup buttons
   TextSelectionPopupCallbackInterface& mTextSelectionPopupCallbackInterface;
@@ -1654,7 +1665,6 @@ struct Decorator::Impl : public ConnectionTracker
   HandleImpl          mHandle[HANDLE_TYPE_COUNT];
 
   PropertyBuffer      mQuadVertices;
-  PropertyBuffer      mQuadIndices;
   Geometry            mQuadGeometry;
   QuadContainer       mHighlightQuadList;         ///< Sub-selections that combine to create the complete selection highlight
 
@@ -1837,10 +1847,10 @@ void Decorator::SetHandleActive( HandleType handleType, bool active )
     // state when the power button is pressed and the application goes to background.
     mImpl->mHandle[handleType].pressed = false;
     Image imageReleased = mImpl->mHandleImages[handleType][HANDLE_IMAGE_RELEASED];
-    ImageActor imageActor = mImpl->mHandle[handleType].actor;
-    if( imageReleased && imageActor )
+    ImageView imageView = mImpl->mHandle[handleType].actor;
+    if( imageReleased && imageView )
     {
-       imageActor.SetImage( imageReleased );
+      imageView.SetImage( imageReleased );
     }
   }