Fix button label centering of text 21/38021/3
authorKingsley Stephens <k.stephens@samsung.com>
Thu, 9 Apr 2015 15:14:57 +0000 (16:14 +0100)
committerKingsley Stephens <k.stephens@samsung.com>
Fri, 10 Apr 2015 09:17:40 +0000 (02:17 -0700)
Change-Id: I4ca6860c96854fc10f671f89a254b73f861d9f0f

dali-toolkit/internal/controls/buttons/button-impl.cpp

index c42531f..44878b6 100644 (file)
@@ -616,6 +616,11 @@ float Button::GetAnimationTime() const
 void Button::SetLabel( const std::string& label )
 {
   Toolkit::TextLabel textLabel = Toolkit::TextLabel::New( label );
+  textLabel.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+  textLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
+  textLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
+  textLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true );
+
   SetLabel( textLabel );
 }