Remove current ScrollBar indicator when setting new customed indicator 73/90773/1
authorminho.sun <minho.sun@samsung.com>
Tue, 4 Oct 2016 07:51:20 +0000 (16:51 +0900)
committerminho.sun <minho.sun@samsung.com>
Tue, 4 Oct 2016 07:51:20 +0000 (16:51 +0900)
 Remove current ScrollBar indicator when setting new customed indicator
using SetScrollIndicator();

Change-Id: Id833be317eb312489bceeadfd1a2bceaf3dde629
Signed-off-by: minho.sun <minho.sun@samsung.com>
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp

index 97e2680..a34e7bd 100755 (executable)
@@ -243,11 +243,16 @@ void ScrollBar::SetScrollIndicator( Actor indicator )
   // Don't allow empty handle
   if( indicator )
   {
   // Don't allow empty handle
   if( indicator )
   {
+    // Remove current Indicator
+    if( mIndicator )
+    {
+      Self().Remove( mIndicator );
+    }
     mIndicator = indicator;
     mIndicatorFirstShow = true;
     mIndicator = indicator;
     mIndicatorFirstShow = true;
-    Self().Add(mIndicator);
+    Self().Add( mIndicator );
 
 
-    EnableGestureDetection(Gesture::Type(Gesture::Pan));
+    EnableGestureDetection( Gesture::Type( Gesture::Pan ) );
 
     PanGestureDetector detector( GetPanGestureDetector() );
     detector.DetachAll();
 
     PanGestureDetector detector( GetPanGestureDetector() );
     detector.DetachAll();