From: Kimmo Hoikka Date: Mon, 20 Apr 2015 17:13:44 +0000 (-0700) Subject: Merge "Size negotiation patch 4: Remove SetRelayoutEnabled" into tizen X-Git-Tag: dali_1.0.39~10 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=b6ed3548dda72ec79dda14612880f1fc06bed2df;hp=-c Merge "Size negotiation patch 4: Remove SetRelayoutEnabled" into tizen --- b6ed3548dda72ec79dda14612880f1fc06bed2df diff --combined dali-toolkit/internal/controls/slider/slider-impl.cpp index 9c5a551,8acd72c..45e4795 --- a/dali-toolkit/internal/controls/slider/slider-impl.cpp +++ b/dali-toolkit/internal/controls/slider/slider-impl.cpp @@@ -96,6 -96,7 +96,7 @@@ const float DEFAULT_WIDTH = 0.0f const float DEFAULT_HEIGHT = 27.0f; const float DEFAULT_HIT_HEIGHT = 72.0f; const float DEFAULT_HANDLE_HEIGHT = DEFAULT_HIT_HEIGHT; + const float POPUP_TEXT_PADDING = 10.0f; const char* SKINNED_BACKING_IMAGE_NAME = DALI_IMAGE_DIR "slider-skin.9.png"; const char* SKINNED_HANDLE_IMAGE_NAME = DALI_IMAGE_DIR "slider-skin-handle.png";; @@@ -326,7 -327,15 +327,7 @@@ void Slider::DisplayValue( float value // Progress bar if( mProgress ) { - if( clampledValue > 0.0f ) - { - mProgress.SetVisible( true ); // Deliberately set this in case multiple SetValues are fired at once - mProgress.SetSize( x, GetBackingRegion().y ); - } - else - { - mProgress.SetVisible( false ); - } + mProgress.SetSize( x, GetBackingRegion().y ); } // Signals @@@ -392,7 -401,6 +393,6 @@@ Actor Slider::CreateHitRegion( ImageActor Slider::CreateBacking() { ImageActor backing = ImageActor::New(); - backing.SetRelayoutEnabled( false ); backing.SetParentOrigin( ParentOrigin::CENTER ); backing.SetAnchorPoint( AnchorPoint::CENTER ); backing.SetZ( BACKING_Z ); @@@ -422,7 -430,6 +422,6 @@@ std::string Slider::GetBackingImageName ImageActor Slider::CreateProgress() { ImageActor progress = ImageActor::New(); - progress.SetRelayoutEnabled( false ); progress.SetParentOrigin( ParentOrigin::CENTER_LEFT ); progress.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); progress.SetZ( PROGRESS_Z ); @@@ -498,7 -505,6 +497,6 @@@ void Slider::ResizeProgressRegion( cons ImageActor Slider::CreateHandle() { ImageActor handle = ImageActor::New(); - handle.SetRelayoutEnabled( false ); handle.SetParentOrigin( ParentOrigin::CENTER_LEFT ); handle.SetAnchorPoint( AnchorPoint::CENTER ); handle.SetZ( HANDLE_Z ); @@@ -509,7 -515,6 +507,6 @@@ ImageActor Slider::CreatePopupArrow() { ImageActor arrow = ImageActor::New(); - arrow.SetRelayoutEnabled( false ); arrow.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); arrow.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); arrow.SetZ( HANDLE_Z ); @@@ -522,18 -527,21 +519,21 @@@ Toolkit::TextLabel Slider::CreatePopupT Toolkit::TextLabel textLabel = Toolkit::TextLabel::New(); textLabel.SetParentOrigin( ParentOrigin::CENTER ); textLabel.SetAnchorPoint( AnchorPoint::CENTER ); + textLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); textLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); textLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); + textLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, DEFAULT_POPUP_TEXT_COLOR ); textLabel.SetZ( VALUE_DISPLAY_TEXT_Z ); + textLabel.SetPadding( Padding( POPUP_TEXT_PADDING, POPUP_TEXT_PADDING, 0.0f, 0.0f ) ); return textLabel; } ImageActor Slider::CreatePopup() { ImageActor popup = ImageActor::New(); - popup.SetRelayoutEnabled( false ); popup.SetParentOrigin( ParentOrigin::TOP_CENTER ); popup.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + popup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::WIDTH ); mValueTextLabel = CreatePopupText(); popup.Add( mValueTextLabel );