Merge remote-tracking branch 'origin/tizen' into new_text 10/38010/1
authorPaul Wisbey <p.wisbey@samsung.com>
Thu, 9 Apr 2015 12:21:16 +0000 (13:21 +0100)
committerPaul Wisbey <p.wisbey@samsung.com>
Thu, 9 Apr 2015 12:22:40 +0000 (13:22 +0100)
Change-Id: Iba714851799e17a461ac18d8431204835675c67b

1  2 
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.h
dali-toolkit/internal/controls/buttons/push-button-impl.cpp
dali-toolkit/public-api/controls/control-impl.cpp

@@@ -580,29 -574,18 +574,18 @@@ Vector3 PushButton::GetNaturalSize(
  {
    Vector3 size;
  
-   // If background and background not scale9 try get size from that
-   ImageActor imageActor = FindImageActor( GetButtonImage() );
-   if( imageActor && imageActor.GetStyle() != ImageActor::STYLE_NINE_PATCH )
-   {
-     size.width = imageActor.GetRelayoutSize( WIDTH );
-     size.height = imageActor.GetRelayoutSize( HEIGHT );
-   }
-   ImageActor backgroundImageActor = FindImageActor( GetBackgroundImage() );
-   if( backgroundImageActor && backgroundImageActor.GetStyle() != ImageActor::STYLE_NINE_PATCH )
-   {
-     size.width = std::max( size.width, backgroundImageActor.GetRelayoutSize( WIDTH ) );
-     size.height = std::max( size.height, backgroundImageActor.GetRelayoutSize( HEIGHT ) );
-   }
+   // Check Image and Background image and use the largest size as the control's Natural size.
+   SizeOfActorIfLarger( GetButtonImage(), size );
+   SizeOfActorIfLarger( GetBackgroundImage(), size );
  
    // If label, test against it's size
 -  Toolkit::TextView textView = Toolkit::TextView::DownCast( GetLabel() );
 -  if( textView )
 +  Toolkit::TextLabel label = Toolkit::TextLabel::DownCast( GetLabel() );
 +  if( label )
    {
 -    Vector3 textViewSize = textView.GetNaturalSize();
 +    Vector3 labelSize = label.GetNaturalSize();
  
 -    size.width = std::max( size.width, textViewSize.width + TEXT_PADDING * 2.0f );
 -    size.height = std::max( size.height, textViewSize.height + TEXT_PADDING * 2.0f );
 +    size.width  = std::max( size.width,  labelSize.width  + TEXT_PADDING * 2.0f );
 +    size.height = std::max( size.height, labelSize.height + TEXT_PADDING * 2.0f );
    }
  
    return size;