X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fpopup%2Fpopup-impl.cpp;h=42981a34ca33c8cce9f18d48ad02077b76840100;hb=37998ba8d5d17e637fe80ff29a2622cc964fe82a;hp=7b8e420c54346f7ccbea2f368ce1450d4f556218;hpb=834ddf7832598a57fc18c282371554a1ed8f0a78;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/popup/popup-impl.cpp b/dali-toolkit/internal/controls/popup/popup-impl.cpp index 7b8e420..42981a3 100755 --- a/dali-toolkit/internal/controls/popup/popup-impl.cpp +++ b/dali-toolkit/internal/controls/popup/popup-impl.cpp @@ -223,11 +223,10 @@ void Popup::SetBackgroundImage( Actor image ) // OnDialogTouched only consume the event. It prevents the touch event to be caught by the backing. mBackgroundImage.TouchedSignal().Connect( this, &Popup::OnDialogTouched ); - mBackgroundImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); + mBackgroundImage.SetResizePolicy( SIZE_FIXED_OFFSET_FROM_PARENT, ALL_DIMENSIONS ); mBackgroundImage.SetAnchorPoint( AnchorPoint::CENTER ); mBackgroundImage.SetParentOrigin( ParentOrigin::CENTER ); - mBackgroundImage.SetSizeMode( SIZE_FIXED_OFFSET_FROM_PARENT ); Vector3 border( mPopupStyle->backgroundOuterBorder.x, mPopupStyle->backgroundOuterBorder.z, 0.0f ); mBackgroundImage.SetSizeModeFactor( border ); @@ -263,41 +262,36 @@ void Popup::SetButtonAreaImage( Actor image ) void Popup::SetTitle( const std::string& text ) { - Toolkit::TextView titleActor = Toolkit::TextView::New(); - titleActor.SetName( "POPUP_TITLE" ); - titleActor.SetText( text ); - titleActor.SetColor( Color::BLACK ); - titleActor.SetMultilinePolicy( Toolkit::TextView::SplitByWord ); - titleActor.SetWidthExceedPolicy( Toolkit::TextView::Split ); - titleActor.SetLineJustification( Toolkit::TextView::Center ); - - SetTitle( titleActor ); -} - -void Popup::SetTitle( Toolkit::TextView titleActor ) -{ // Replaces the current title actor. if( mPopupLayout ) { mPopupLayout.RemoveChildAt( Toolkit::TableView::CellPosition( 0, 0 ) ); } - mTitle = titleActor; + mTitle = Toolkit::TextLabel::New( text ); + mTitle.SetName( "POPUP_TITLE" ); + mTitle.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true ); + mTitle.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); if( mPopupLayout ) { mTitle.SetPadding( Padding( 0.0f, 0.0f, mPopupStyle->margin, mPopupStyle->margin ) ); mTitle.SetResizePolicy( FILL_TO_PARENT, WIDTH ); - mTitle.SetDimensionDependency( HEIGHT, WIDTH ); // HeightForWidth + mTitle.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT ); mPopupLayout.AddChild( mTitle, Toolkit::TableView::CellPosition( 0, 0 ) ); } RelayoutRequest(); } -Toolkit::TextView Popup::GetTitle() const +std::string Popup::GetTitle() const { - return mTitle; + if( mTitle ) + { + return mTitle.GetProperty( Toolkit::TextLabel::Property::TEXT ); + } + + return std::string(); } void Popup::CreateFooter() @@ -748,7 +742,7 @@ Vector3 Popup::GetNaturalSize() const float titleBuffer = 0.5f; titleNaturalSize.width += titleBuffer; - // As TextView GetNaturalSize does not take wrapping into account, limit the width + // As TextLabel GetNaturalSize does not take wrapping into account, limit the width // to that of the stage if( titleNaturalSize.width >= maxWidth) {