X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-selection-popup-impl.cpp;h=01ede363b79d36c638f056bd0cda1522dd631dec;hp=133fa0961f42dc41b590631edf49714e58c9a26c;hb=fc72d9dfdefd7434202ed73ac579d425279947f3;hpb=826a077bb3183b5d317bfb22e14ab4e217d26f40 diff --git a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp index 133fa09..01ede36 100644 --- a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp @@ -438,23 +438,22 @@ Dali::Image TextSelectionPopup::GetPopupImage( PopupParts part ) // 1. Create the backgrounds for the popup option both normal and pressed. // Both containers will be added to a button. Actor optionContainer = Actor::New(); + optionContainer.SetRelayoutEnabled( true ); optionContainer.SetDrawMode( DrawMode::OVERLAY ); - //optionContainer.SetParentOrigin( ParentOrigin::CENTER ); optionContainer.SetAnchorPoint( AnchorPoint::TOP_LEFT ); ImageActor optionPressedContainer = Toolkit::CreateSolidColorActor( mBackgroundPressedColor ); optionPressedContainer.SetDrawMode( DrawMode::OVERLAY ); - //optionPressedContainer.SetParentOrigin( ParentOrigin::CENTER ); optionPressedContainer.SetAnchorPoint( AnchorPoint::TOP_LEFT ); // 2. Add text. Toolkit::TextLabel captionTextLabel = Toolkit::TextLabel::New(); captionTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, caption ); - optionContainer.Add( captionTextLabel ); + // optionContainer.Add( captionTextLabel ); Temporary removed. Toolkit::TextLabel pressedCaptionTextLabel = Toolkit::TextLabel::New(); pressedCaptionTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, caption ); - optionPressedContainer.Add( pressedCaptionTextLabel ); + // optionPressedContainer.Add( pressedCaptionTextLabel ); Temporary removed. // Calculates the icon/text position. float iconTextOffsetY = 0.0f; @@ -500,8 +499,8 @@ Dali::Image TextSelectionPopup::GetPopupImage( PopupParts part ) textSize.width = std::min( textSize.width, OPTION_MAX_WIDTH - 2.f * OPTION_MARGIN_WIDTH ); // Set the size to the text. Text will be ellipsized if exceeds the max width. - captionTextLabel.SetSize( textSize ); - pressedCaptionTextLabel.SetSize( textSize ); + captionTextLabel.SetSize( textSize.GetVectorXY() ); + pressedCaptionTextLabel.SetSize( textSize.GetVectorXY() ); // 4. Calculate the size of option. @@ -515,7 +514,6 @@ Dali::Image TextSelectionPopup::GetPopupImage( PopupParts part ) // 5. Create a option. Toolkit::PushButton option = Toolkit::PushButton::New(); - //option.SetSizePolicy( Toolkit::Control::Fixed, Toolkit::Control::Fixed ); FIXME option.SetSize( optionSize ); option.SetAnchorPoint( AnchorPoint::TOP_LEFT ); option.SetX( mContentSize.width ); @@ -541,7 +539,7 @@ Dali::Image TextSelectionPopup::GetPopupImage( PopupParts part ) const Size size( POPUP_DIVIDER_WIDTH, mContentSize.height ); ImageActor divider = Toolkit::CreateSolidColorActor( Color::WHITE ); - divider.SetSize (size); + divider.SetSize( size ); divider.SetParentOrigin( ParentOrigin::TOP_LEFT ); divider.SetAnchorPoint( AnchorPoint::TOP_LEFT ); divider.SetPosition( mContentSize.width - POPUP_DIVIDER_WIDTH, 0.0f ); @@ -559,14 +557,15 @@ Dali::Image TextSelectionPopup::GetPopupImage( PopupParts part ) stencil.SetDrawMode( DrawMode::STENCIL ); stencil.SetVisible( true ); Actor scrollview = Actor::New(); //todo make a scrollview + stencil.SetRelayoutEnabled( true ); - //todo Use Size negotiation - //self.SetSize( size ); // control matches stencil size self.SetSize( mRequiredPopUpSize ); // control matches stencil size + mStencilLayer.SetSize( size ); // matches stencil size - stencil.SetSize( size ); - scrollview.SetSize( size ); - mButtons.SetSize( size ); + + stencil.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); + scrollview.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); + mButtons.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); mStencilLayer.SetAnchorPoint(AnchorPoint::TOP_LEFT); scrollview.SetAnchorPoint(AnchorPoint::TOP_LEFT); @@ -587,6 +586,7 @@ Dali::Image TextSelectionPopup::GetPopupImage( PopupParts part ) mContentSize = Vector2::ZERO; mButtons = Actor::New(); + mButtons.SetRelayoutEnabled( true ); // Add the options into the buttons container.