From: Richard Huang Date: Wed, 31 May 2017 10:22:17 +0000 (+0100) Subject: Fix the broken popup layout in text field example X-Git-Tag: accepted/tizen/3.0/common/20170714.174713~3 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-demo.git;a=commitdiff_plain;h=0efc4e729b2c12240d9d68f5df1929494685fb7f Fix the broken popup layout in text field example Change-Id: Ib41eca6d950050e11d0ed64766ef51eb0b30e0ac --- diff --git a/examples/text-field/text-field-example.cpp b/examples/text-field/text-field-example.cpp index 1b21b48..84153e6 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;