[Tizen] Update the size of accessibility highlight on Relayout 46/306446/2 accepted/tizen/7.0/unified/20240223.161503
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Wed, 21 Feb 2024 10:57:47 +0000 (19:57 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Thu, 22 Feb 2024 05:55:17 +0000 (14:55 +0900)
- Accessibility highlight frame should be updated together
 when the componet size changes.
- Currently, if the component size changes while the component is still
 highlighted, then the frame will remain in its original size.

Change-Id: I995e0ec5907dd23282010e0186a7881335dc48ea
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
dali-toolkit/public-api/controls/control-impl.cpp

index 3ffaffd..60aaa28 100644 (file)
@@ -670,6 +670,22 @@ void Control::OnRelayout(const Vector2& size, RelayoutContainer& container)
     container.Add(child, newChildSize);
   }
 
+  if(Accessibility::IsUp())
+  {
+    auto accessible = GetAccessibleObject();
+    if(DALI_LIKELY(accessible))
+    {
+      auto highlightFrame = accessible->GetHighlightActor();
+      if(accessible->GetCurrentlyHighlightedActor() == this->Self() &&
+         highlightFrame.GetProperty<Vector3>(Dali::Actor::Property::SIZE).GetVectorXY() != size)
+      {
+        // TODO : Need to consider how we can reduce this cost
+        highlightFrame.SetProperty(Actor::Property::SIZE, size);
+        container.Add(highlightFrame, size);
+      }
+    }
+  }
+
   Toolkit::Visual::Base visual = mImpl->GetVisual(Toolkit::Control::Property::BACKGROUND);
   if(visual)
   {