Stop using Z-position hacks in text-label.example 30/40130/1
authorPaul Wisbey <p.wisbey@samsung.com>
Fri, 29 May 2015 09:56:24 +0000 (10:56 +0100)
committerPaul Wisbey <p.wisbey@samsung.com>
Fri, 29 May 2015 09:56:26 +0000 (10:56 +0100)
(also stop hiding the text with mGrabCorner)

Change-Id: I74c91714615e44384c1baadfc74621bd9f11c4f9

examples/text-label/text-label-example.cpp
resources/images/grab-handle.png [new file with mode: 0644]

index 12192906acb9e1f534808e882ae29457f52fd31d..9d12f7d9835b915337a4dc3d6f2c4ca48578a038 100644 (file)
@@ -34,7 +34,7 @@ using namespace MultiLanguageStrings;
 
 namespace
 {
-  const char* const BACKGROUND_IMAGE = DALI_IMAGE_DIR "button-up.9.png";
+  const char* const BACKGROUND_IMAGE = DALI_IMAGE_DIR "grab-handle.png";
 
   const unsigned int KEY_ZERO = 10;
   const unsigned int KEY_ONE = 11;
@@ -107,16 +107,16 @@ public:
     mContainer.SetParentOrigin( ParentOrigin::CENTER );
     mLayoutSize = Vector2(stageSize.width*0.6f, stageSize.width*0.6f);
     mContainer.SetSize( mLayoutSize );
+    mContainer.SetDrawMode( DrawMode::OVERLAY );
     stage.Add( mContainer );
 
     // Resize the center layout when the corner is grabbed
     mGrabCorner = Control::New();
     mGrabCorner.SetName( "GrabCorner" );
-    mGrabCorner.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT );
+    mGrabCorner.SetAnchorPoint( AnchorPoint::TOP_CENTER );
     mGrabCorner.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT );
-    mGrabCorner.SetSize( Vector2(stageSize.width*0.1f, stageSize.width*0.1f) );
-    mGrabCorner.SetZ(1.0f);
-    mGrabCorner.SetBackgroundColor( Color::YELLOW );
+    mGrabCorner.SetBackgroundImage( ResourceImage::New( BACKGROUND_IMAGE ) );
+    mGrabCorner.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
     mContainer.Add( mGrabCorner );
 
     mPanGestureDetector = PanGestureDetector::New();
diff --git a/resources/images/grab-handle.png b/resources/images/grab-handle.png
new file mode 100644 (file)
index 0000000..61ab852
Binary files /dev/null and b/resources/images/grab-handle.png differ