X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fscroll-bar%2Fscroll-bar-impl.cpp;h=ddf5738ffe16ba26fe7e57a70e4eee32675c30c7;hb=7a369e9fac30bd1b96659d74a706798619b5d215;hp=f10dfb515594d83dca83808da8dd1e1423ee85ed;hpb=7e315e8b217ab571598d8db28df867a5da0b99d7;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp index f10dfb5..ddf5738 100755 --- a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp +++ b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -175,7 +175,7 @@ const char* INDICATOR_HEIGHT_POLICY_NAME[] = {"Variable", "Fixed"}; } ScrollBar::ScrollBar(Toolkit::ScrollBar::Direction direction) -: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ), +: Control( ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ), mIndicatorShowAlpha(1.0f), mDirection(direction), mScrollableObject(WeakHandleBase()), @@ -234,7 +234,7 @@ void ScrollBar::CreateDefaultIndicatorActor() Toolkit::ImageView indicator = Toolkit::ImageView::New( DEFAULT_INDICATOR_IMAGE_PATH ); indicator.SetParentOrigin( ParentOrigin::TOP_LEFT ); indicator.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - + indicator.SetStyleName( "ScrollBarIndicator" ); SetScrollIndicator(indicator); } @@ -243,11 +243,23 @@ void ScrollBar::SetScrollIndicator( Actor indicator ) // Don't allow empty handle if( indicator ) { + // Remove current Indicator + if( mIndicator ) + { + Self().Remove( mIndicator ); + } mIndicator = indicator; + + Toolkit::Control control = Toolkit::Control::DownCast( mIndicator ); + if( control ) + { + control.SetStyleName( "ScrollBarIndicator" ); + } + mIndicatorFirstShow = true; - Self().Add(mIndicator); + Self().Add( mIndicator ); - EnableGestureDetection(Gesture::Type(Gesture::Pan)); + EnableGestureDetection( Gesture::Type( Gesture::Pan ) ); PanGestureDetector detector( GetPanGestureDetector() ); detector.DetachAll(); @@ -491,6 +503,8 @@ void ScrollBar::OnSizeSet( const Vector3& size ) { mIndicator.SetSize(size.width, mIndicatorFixedHeight); } + + Control::OnSizeSet( size ); } void ScrollBar::SetScrollDirection( Toolkit::ScrollBar::Direction direction )