+ Toolkit::TextLabel textLabel = Toolkit::TextLabel::DownCast( label );
+ if( textLabel )
+ {
+ textLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, false );
+ }
+ }
+ ConfigureSizeNegotiation();
+}
+
+void PushButton::OnButtonImageSet()
+{
+ ConfigureSizeNegotiation();
+}
+
+void PushButton::OnSelectedImageSet()
+{
+ ConfigureSizeNegotiation();
+}
+
+void PushButton::OnBackgroundImageSet()
+{
+ ConfigureSizeNegotiation();
+}
+
+void PushButton::OnSelectedBackgroundImageSet()
+{
+ ConfigureSizeNegotiation();
+}
+
+void PushButton::OnDisabledImageSet()
+{
+ ConfigureSizeNegotiation();
+}
+
+void PushButton::OnDisabledSelectedImageSet()
+{
+ ConfigureSizeNegotiation();
+}
+
+void PushButton::OnDisabledBackgroundImageSet()
+{
+ ConfigureSizeNegotiation();
+}
+
+void PushButton::OnSizeSet( const Vector3& targetSize )
+{
+ if( targetSize != mSize )
+ {
+ mSize = targetSize;
+
+ Actor& label = GetLabelActor();
+
+ if( label )
+ {
+ label.SetSize( mSize );
+ }
+ }
+}
+
+void PushButton::PrepareForTranstionIn( Actor actor )
+{
+ actor.SetOpacity( 0.0f );
+}
+
+void PushButton::PrepareForTranstionOut( Actor actor )
+{
+ actor.SetOpacity( 1.0f );
+}
+
+void PushButton::OnTransitionIn( Actor actor )
+{
+ FadeImageTo( actor, 1.f );
+}
+
+void PushButton::OnTransitionOut( Actor actor )
+{
+ FadeImageTo( actor, 0.0f );
+}
+
+void PushButton::FadeImageTo( Actor actor, float opacity )
+{
+ if( actor )
+ {
+ Dali::Animation transitionAnimation = GetTransitionAnimation();
+ DALI_ASSERT_DEBUG( transitionAnimation );
+
+ if( transitionAnimation )
+ {
+ transitionAnimation.AnimateTo( Property( actor, Actor::Property::COLOR_ALPHA ), opacity );
+ }
+ }
+}
+
+Vector3 PushButton::GetNaturalSize()
+{
+ Vector3 size;
+
+ // If label, test against it's size
+ Toolkit::TextLabel label = Toolkit::TextLabel::DownCast( GetLabelActor() );
+
+ Actor icon = GetDecoration( UNSELECTED_DECORATION );
+ if( label || icon )
+ {
+ Vector3 labelSize( Vector3::ZERO );
+ Vector3 iconSize( Vector3::ZERO );
+
+ if( label )
+ {
+ Vector3 labelNaturalSize = label.GetNaturalSize();
+ labelSize.width = labelNaturalSize.width + mLabelPadding.left + mLabelPadding.right;
+ labelSize.height = labelNaturalSize.height + mLabelPadding.top + mLabelPadding.bottom;
+ }
+
+ if( icon )
+ {
+ Vector3 iconNaturalSize = icon.GetNaturalSize();
+ iconSize.width = iconNaturalSize.width + mIconPadding.left + mIconPadding.right;
+ iconSize.height = iconNaturalSize.height + mIconPadding.top + mIconPadding.bottom;
+
+ switch( mIconAlignment )