From: Paul Wisbey Date: Thu, 9 Apr 2015 12:21:16 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/tizen' into new_text X-Git-Tag: dali_1.0.38~11^2~2^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d04c5bdbb95cc98f90848c7a98b0b2804df6e5b8;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Merge remote-tracking branch 'origin/tizen' into new_text Change-Id: Iba714851799e17a461ac18d8431204835675c67b --- d04c5bdbb95cc98f90848c7a98b0b2804df6e5b8 diff --cc dali-toolkit/internal/controls/buttons/push-button-impl.cpp index 24fa230,1890686..3910e43 --- a/dali-toolkit/internal/controls/buttons/push-button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/push-button-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;