X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Fradio-button-impl.cpp;h=81b6a5d9c6c47cbef01a9eba85ff75cecaa124a0;hp=96b588cc171297fbbeaae0f3596f6586945c65b7;hb=fc72d9dfdefd7434202ed73ac579d425279947f3;hpb=2bd2fe7caf1c644327c63d1310135510685eee60 diff --git a/dali-toolkit/internal/controls/buttons/radio-button-impl.cpp b/dali-toolkit/internal/controls/buttons/radio-button-impl.cpp index 96b588c..81b6a5d 100644 --- a/dali-toolkit/internal/controls/buttons/radio-button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/radio-button-impl.cpp @@ -77,7 +77,7 @@ void RadioButton::OnButtonInitialize() Actor self = Self(); // Wrap size of radio button around all its children - self.SetResizePolicy( FIT_TO_CHILDREN, ALL_DIMENSIONS ); + self.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS ); Image buttonImage = Dali::ResourceImage::New( UNSELECTED_BUTTON_IMAGE_DIR ); Image selectedImage = Dali::ResourceImage::New( SELECTED_BUTTON_IMAGE_DIR ); @@ -109,6 +109,12 @@ void RadioButton::OnLabelSet() label.SetParentOrigin( ParentOrigin::CENTER_LEFT ); label.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); + // Radio button width is FIT_TO_CHILDREN, so the label must have a sensible policy to fill out the space + if( label.GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::FILL_TO_PARENT ) + { + label.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::WIDTH ); + } + if( IsSelected() ) { label.SetX( GetSelectedImage().GetNaturalSize().width + DISTANCE_BETWEEN_IMAGE_AND_LABEL );