Add style name to indicator of ScrollBar 27/112127/4
authorminho.sun <minho.sun@samsung.com>
Thu, 26 Jan 2017 06:37:14 +0000 (15:37 +0900)
committerminho.sun <minho.sun@samsung.com>
Thu, 2 Feb 2017 10:35:46 +0000 (19:35 +0900)
Add style name to indicator of scrollbar.
Now developer can set their indicator style via stylesheet

Change-Id: Ifc6007147472ae7cc13161cc25c3c53eec5c11b0
Signed-off-by: minho.sun <minho.sun@samsung.com>
automated-tests/src/dali-toolkit/utc-Dali-ScrollBar.cpp
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp

index ea50a30..ded233f 100644 (file)
@@ -470,6 +470,11 @@ int UtcDaliToolkitScrollBarSetScrollIndicatorP(void)
   DALI_TEST_CHECK( indicator != scrollBar.GetScrollIndicator() );
   DALI_TEST_CHECK( newIndicator == scrollBar.GetScrollIndicator() );
 
+  // Check that the new control indicator is successfully set
+  Control controlIndicator = Control::New();
+  scrollBar.SetScrollIndicator(controlIndicator);
+
+  DALI_TEST_CHECK( controlIndicator == Control::DownCast( scrollBar.GetScrollIndicator() ) );
   END_TEST;
 }
 
index 6e301cb..ddf5738 100755 (executable)
@@ -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);
 }
 
@@ -249,6 +249,13 @@ void ScrollBar::SetScrollIndicator( Actor indicator )
       Self().Remove( mIndicator );
     }
     mIndicator = indicator;
+
+    Toolkit::Control control = Toolkit::Control::DownCast( mIndicator );
+    if( control )
+    {
+      control.SetStyleName( "ScrollBarIndicator" );
+    }
+
     mIndicatorFirstShow = true;
     Self().Add( mIndicator );