Tabbar changes for bringing the seleceted item to focus
authorvipul <vipul.kumar@samsung.com>
Thu, 29 Aug 2013 09:51:39 +0000 (15:21 +0530)
committervipul <vipul.kumar@samsung.com>
Fri, 30 Aug 2013 05:12:41 +0000 (10:42 +0530)
Signed-off-by: vipul <vipul.kumar@samsung.com>
Change-Id: I9d88a253ff4f1a9d7c6d90f18a92f528912fb03a

src/ui/controls/FUiCtrl_TabBarPresenter.cpp

index 39ced7d..a97875b 100644 (file)
@@ -353,6 +353,19 @@ _TabBarPresenter::SetItemSelected(int index)
                pElement->SetHintDisabled(true);
        }
 
+       FloatRectangle itemBounds = pItem->GetBounds();
+       FloatRectangle clientBounds = __tabBar.GetBoundsF();
+
+       if (itemBounds.x < 0.0f)
+       {
+               SetTopDrawnItemIndex(index);
+       }
+       else if ((clientBounds.width - __sideMargin * 2.0f - __arrowMargin * 2.0f) < (itemBounds.x + itemBounds.width))
+       {
+               float movableDistance = (itemBounds.x + itemBounds.width) - (clientBounds.width - __sideMargin * 2.0f - __arrowMargin * 2.0f);
+               AdjustItemPositionX(-movableDistance);
+       }
+
        __pTabBarModel->SetSelectedItemIndex(index);
 
        return E_SUCCESS;