From 69b938841cf1ee06dde7659fa56ecfac20d48923 Mon Sep 17 00:00:00 2001 From: Kingsley Stephens Date: Thu, 9 Apr 2015 16:14:57 +0100 Subject: [PATCH 1/1] Fix button label centering of text Change-Id: I4ca6860c96854fc10f671f89a254b73f861d9f0f --- dali-toolkit/internal/controls/buttons/button-impl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dali-toolkit/internal/controls/buttons/button-impl.cpp b/dali-toolkit/internal/controls/buttons/button-impl.cpp index c42531f..44878b6 100644 --- a/dali-toolkit/internal/controls/buttons/button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/button-impl.cpp @@ -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 ); } -- 2.7.4