diff options
author | Richard Huang <r.huang@samsung.com> | 2017-05-31 11:22:17 +0100 |
---|---|---|
committer | Richard Huang <r.huang@samsung.com> | 2017-05-31 11:22:17 +0100 |
commit | 0efc4e729b2c12240d9d68f5df1929494685fb7f (patch) | |
tree | 570a07b0c0c44535b617683732bcd77b6b3d0e11 | |
parent | db0b420d33ad8f4659f88d59cf7fb2a6147708e6 (diff) | |
download | dali-demo-0efc4e729b2c12240d9d68f5df1929494685fb7f.tar.gz dali-demo-0efc4e729b2c12240d9d68f5df1929494685fb7f.tar.bz2 dali-demo-0efc4e729b2c12240d9d68f5df1929494685fb7f.zip |
Fix the broken popup layout in text field example
Change-Id: Ib41eca6d950050e11d0ed64766ef51eb0b30e0ac
-rw-r--r-- | examples/text-field/text-field-example.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/examples/text-field/text-field-example.cpp b/examples/text-field/text-field-example.cpp index 1b21b48b..84153e62 100644 --- a/examples/text-field/text-field-example.cpp +++ b/examples/text-field/text-field-example.cpp @@ -42,8 +42,6 @@ namespace const float BORDER_WIDTH = 4.0f; - const Vector3 POPUP_SIZE_FACTOR_TO_PARENT = Vector3( 0.0, 0.25, 0.0 ); - } // unnamed namespace /** @@ -106,7 +104,7 @@ public: // Launch a pop-up containing TextField mField = CreateTextField( stageSize, mButtonLabel ); - mPopup = CreatePopup( stageSize.width * 0.8f ); + mPopup = CreatePopup(); mPopup.Add( mField ); mPopup.OutsideTouchedSignal().Connect( this, &TextFieldExample::OnPopupOutsideTouched ); stage.Add( mPopup ); @@ -131,14 +129,13 @@ public: return field; } - Popup CreatePopup( float width ) + Popup CreatePopup() { Popup popup = Popup::New(); popup.SetParentOrigin( ParentOrigin::CENTER ); popup.SetAnchorPoint( AnchorPoint::CENTER ); - popup.SetSize( width, 0.0f ); - popup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::HEIGHT ); - popup.SetSizeModeFactor( POPUP_SIZE_FACTOR_TO_PARENT ); + popup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::WIDTH ); + popup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT ); popup.TouchSignal().Connect( this, &TextFieldExample::OnPopupTouched ); return popup; |