From: Paul Wisbey
Date: Fri, 29 May 2015 09:56:24 +0000 (+0100)
Subject: Stop using Z-position hacks in text-label.example
X-Git-Tag: dali_1.0.43~9
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F30%2F40130%2F1;p=platform%2Fcore%2Fuifw%2Fdali-demo.git
Stop using Z-position hacks in text-label.example
(also stop hiding the text with mGrabCorner)
Change-Id: I74c91714615e44384c1baadfc74621bd9f11c4f9
---
diff --git a/examples/text-label/text-label-example.cpp b/examples/text-label/text-label-example.cpp
index 12192906..9d12f7d9 100644
--- a/examples/text-label/text-label-example.cpp
+++ b/examples/text-label/text-label-example.cpp
@@ -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
index 00000000..61ab8529
Binary files /dev/null and b/resources/images/grab-handle.png differ