[dali_2.0.30] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / accessible-impl.cpp
index dd1fc93..fd3e72e 100644 (file)
@@ -168,7 +168,6 @@ Dali::Accessibility::States AccessibleImpl::CalculateStates()
   s[Dali::Accessibility::State::HIGHLIGHTED] = GetCurrentlyHighlightedActor() == self;
   s[Dali::Accessibility::State::ENABLED]     = true;
   s[Dali::Accessibility::State::SENSITIVE]   = true;
-  s[Dali::Accessibility::State::ANIMATED]    = self.GetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_ANIMATED).Get<bool>();
   s[Dali::Accessibility::State::VISIBLE]     = true;
   if(modal)
   {
@@ -262,12 +261,28 @@ static Dali::Actor CreateHighlightIndicatorActor()
   auto actor = Toolkit::ImageView::New(focusBorderImagePath);
   actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
   DevelControl::AppendAccessibilityAttribute(actor, "highlight", "");
-  actor.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_ANIMATED, true);
   actor.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, false);
 
   return actor;
 }
 
+void AccessibleImpl::ScrollToSelf()
+{
+  auto* child = this;
+  auto* parent = dynamic_cast<Toolkit::DevelControl::AccessibleImpl*>(child->GetParent());
+
+  while (parent)
+  {
+    if (parent->IsScrollable())
+    {
+      parent->ScrollToChild(child->Self());
+    }
+
+    child = parent;
+    parent = dynamic_cast<Toolkit::DevelControl::AccessibleImpl*>(parent->GetParent());
+  }
+}
+
 bool AccessibleImpl::GrabHighlight()
 {
   Dali::Actor self = Self();
@@ -297,7 +312,7 @@ bool AccessibleImpl::GrabHighlight()
   // Remember the highlight actor, so that when the default is changed with
   // SetHighlightActor(), the currently displayed highlight can still be cleared.
   currentHighlightActor = highlight;
-  EnsureSelfVisible();
+  ScrollToSelf();
   self.Add(highlight);
   SetCurrentlyHighlightedActor(self);
   EmitHighlighted(true);
@@ -404,17 +419,9 @@ std::vector<Dali::Accessibility::Relation> AccessibleImpl::GetRelationSet()
   return ret;
 }
 
-void AccessibleImpl::EnsureChildVisible(Actor child)
-{
-}
-
-void AccessibleImpl::EnsureSelfVisible()
+bool AccessibleImpl::ScrollToChild(Actor child)
 {
-  auto parent = dynamic_cast<AccessibleImpl*>(GetParent());
-  if(parent)
-  {
-    parent->EnsureChildVisible(Self());
-  }
+  return false;
 }
 
 Dali::Property::Index AccessibleImpl::GetNamePropertyIndex()