#include <dali/public-api/object/type-registry.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/text-view/text-view.h>
+#include <dali-toolkit/public-api/controls/text-controls/text-label.h>
namespace Dali
{
if ( root )
{
// RelayoutSize retreived for Actor to use any padding set to it.
- size.width = std::max( root.GetRelayoutSize( WIDTH ), size.width );
- size.height = std::max( root.GetRelayoutSize( HEIGHT ), size.height );
+ size.width = std::max( root.GetRelayoutSize( Dimension::WIDTH ), size.width );
+ size.height = std::max( root.GetRelayoutSize( Dimension::HEIGHT ), size.height );
}
}
self.SetLeaveRequired( true );
// Set resize policy to natural size so that buttons will resize to background images
- self.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
+ self.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
}
void PushButton::OnLabelSet()
{
label.SetAnchorPoint( AnchorPoint::CENTER );
label.SetParentOrigin( ParentOrigin::CENTER );
- label.SetSize( mSize );
+ label.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+
+ Toolkit::TextLabel textLabel = Toolkit::TextLabel::DownCast( label );
+ if( textLabel )
+ {
+ textLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
+ textLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
+ textLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true );
+ }
}
}
{
Actor& buttonImage = GetButtonImage();
- buttonImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ buttonImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
buttonImage.RelayoutRequestTree();
{
Actor& selectedImage = GetSelectedImage();
- selectedImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ selectedImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
selectedImage.RelayoutRequestTree();
{
Actor& backgroundImage = GetBackgroundImage();
- backgroundImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backgroundImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
backgroundImage.RelayoutRequestTree();
{
Actor& selectedBackgroundImage = GetSelectedBackgroundImage();
- selectedBackgroundImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ selectedBackgroundImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
}
void PushButton::OnDisabledImageSet()
{
Actor& disabledImage = GetDisabledImage();
- disabledImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ disabledImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
disabledImage.RelayoutRequestTree();
{
Actor& disabledBackgroundImage = GetDisabledBackgroundImage();
- disabledBackgroundImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ disabledBackgroundImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
disabledBackgroundImage.RelayoutRequestTree();
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;