fix setselected
authorMyung Jin Kim <critical.kim@samsung.com>
Wed, 24 Apr 2013 09:59:16 +0000 (18:59 +0900)
committerMyung Jin Kim <critical.kim@samsung.com>
Wed, 24 Apr 2013 09:59:16 +0000 (18:59 +0900)
Change-Id: I7a97a1be17dc2895eadbcd24f1986dfe642f2a8f

src/ui/controls/FUiCtrl_ToolbarPresenter.cpp

index 0adbf04..e199d94 100644 (file)
@@ -959,20 +959,6 @@ _ToolbarPresenter::SetDescriptionText(const String& description)
 result
 _ToolbarPresenter::SetItemSelected(int itemIndex)
 {
-       ToolbarStyle style = __pToolbar->GetStyle();
-
-       if ((style == TOOLBAR_TAB || style == TOOLBAR_TAB_WITH_TITLE) && __pToolbar->GetItemCount() > SEGMENTED_ITEM_MAX)
-       {
-               if (itemIndex <= __pToolbar->GetItemCount() - SEGMENTED_ITEM_MAX)
-               {
-                       SetItemFit(itemIndex);
-               }
-               else
-               {
-                       SetItemFit(__pToolbar->GetItemCount() - SEGMENTED_ITEM_MAX);
-               }
-       }
-
        return __pToolbarModel->SetSelectedItemIndex(itemIndex);
 }
 
@@ -1196,7 +1182,7 @@ _ToolbarPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& tou
        }
        else
        {
-               if ((style == TOOLBAR_TAB || style == TOOLBAR_TAB_WITH_TITLE) && __pToolbar->GetItemCount() > SEGMENTED_ITEM_MAX)
+               if ((style == TOOLBAR_TAB || style == TOOLBAR_TAB_WITH_TITLE) && __pToolbar->GetItemCount() > 4)
                {
                        if (__pressedItemIndex != -1)
                        {
@@ -1291,7 +1277,7 @@ _ToolbarPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchi
 
        FloatRectangle itemBounds = pCurrentButton->GetBoundsF();
 
-       if ((style == TOOLBAR_TAB || style == TOOLBAR_TAB_WITH_TITLE) && __pToolbar->GetItemCount() > SEGMENTED_ITEM_MAX)
+       if ((style == TOOLBAR_TAB || style == TOOLBAR_TAB_WITH_TITLE) && __pToolbar->GetItemCount() > 4)
        {
                if (itemBounds.Contains(touchPoint))
                {
@@ -1549,7 +1535,7 @@ _ToolbarPresenter::OnFlickGestureDetected(_TouchFlickGestureDetector& gesture)
 {
        ToolbarStyle style = __pToolbar->GetStyle();
 
-       if (!(style == TOOLBAR_TAB || style == TOOLBAR_TAB_WITH_TITLE) || __pToolbar->GetItemCount() <= SEGMENTED_ITEM_MAX || __beingEdited == true || __tabMoved == false)
+       if (!(style == TOOLBAR_TAB || style == TOOLBAR_TAB_WITH_TITLE) || __pToolbar->GetItemCount() <= 4 || __beingEdited == true || __tabMoved == false)
        {
                return true;
        }
@@ -1968,11 +1954,6 @@ _ToolbarPresenter::CalculateProgress(float timeProgress) const
 void
 _ToolbarPresenter::SetItemFit(int index)
 {
-       if (index < 0)
-       {
-               return ;
-       }
-
        FloatPoint pt(0.0f, 0.0f);
        FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f);