DALI_TEST_CHECK( toolbar );
END_TEST;
}
+
+int UtcDaliToolkitTextSelectionToolBarScrollView(void)
+{
+ // Configures the ScrollView within the TextSelectionToolbar
+ ToolkitTestApplication application;
+
+ TextSelectionToolbar toolbar = TextSelectionToolbar::New();
+ DALI_TEST_CHECK( toolbar );
+ Stage::GetCurrent().Add( toolbar );
+
+ Property::Map map;
+ map["overshootEffectColor"] = Color::RED;
+ map["overshootSize"] = Vector2(50.0f, 50.f);
+ toolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::SCROLL_VIEW, map );
+
+ application.SendNotification();
+ application.Render();
+
+ Actor actor = toolbar.FindChildByName("TextSelectionScrollView");
+ DALI_TEST_CHECK( actor );
+
+ ScrollView scrollView = ScrollView::DownCast( actor );
+ DALI_TEST_CHECK( scrollView );
+
+ Vector4 color = scrollView.GetProperty<Vector4>( Toolkit::Scrollable::Property::OVERSHOOT_EFFECT_COLOR );
+ DALI_TEST_EQUALS( color, Color::RED, TEST_LOCATION );
+
+ Vector2 size = scrollView.GetProperty<Vector2>( Toolkit::Scrollable::Property::OVERSHOOT_SIZE );
+ DALI_TEST_EQUALS( size, Vector2(50.0f, 50.f), TEST_LOCATION );
+
+ END_TEST;
+}
+
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
+#include <dali-toolkit/internal/helpers/color-conversion.h>
namespace Dali
{
void TextSelectionToolbar::SetUpScrollView()
{
+ mScrollView.SetName("TextSelectionScrollView");
mScrollView.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
mScrollView.SetParentOrigin( ParentOrigin::CENTER_LEFT );
mScrollView.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
Property::Index setPropertyIndex = mScrollView.GetPropertyIndex( propertyPair.first );
if( setPropertyIndex != Property::INVALID_INDEX )
{
- // If the conversion worked, we have a valid property index,
- // Set the property to the new value.
- mScrollView.SetProperty( setPropertyIndex, propertyPair.second );
+ // Convert the string representation of a color into a Vector4
+ if( setPropertyIndex == Toolkit::Scrollable::Property::OVERSHOOT_EFFECT_COLOR )
+ {
+ Vector4 color;
+ if( ConvertPropertyToColor( propertyPair.second, color ) )
+ {
+ mScrollView.SetOvershootEffectColor( color );
+ }
+ }
+ else
+ {
+ // If the conversion worked, we have a valid property index,
+ // Set the property to the new value.
+ mScrollView.SetProperty( setPropertyIndex, propertyPair.second );
+ }
}
}