[N_SE-40288] Using same seleting effect for all indexes
authorSungHee Kim <sh.victoria.kim@samsung.com>
Tue, 4 Jun 2013 12:16:05 +0000 (21:16 +0900)
committerSungHee Kim <sh.victoria.kim@samsung.com>
Tue, 4 Jun 2013 12:16:20 +0000 (21:16 +0900)
Change-Id: I89218ae544aa187ae0d4b9f6f4e95858f99fb761
Signed-off-by: SungHee Kim <sh.victoria.kim@samsung.com>
src/ui/controls/FUiCtrl_FastScrollPresenter.cpp

index 263fd60..9bc7316 100644 (file)
@@ -679,7 +679,6 @@ _FastScrollIndexView::AddAccessibilityElement(const _AccessibilityContainer& con
        FloatRectangle bounds = __pBaseIndexVe->GetBounds();
        float indexHeight = GetIndexHeight();
        FloatRectangle indexRect(bounds.x, __viewConfig.__indexMarginTop, bounds.width, indexHeight);
-       int nonOmittedIndex = 0;
 
        _AccessibilityElement* pAccessibilityElement = null;
        result r = E_SUCCESS;
@@ -688,11 +687,10 @@ _FastScrollIndexView::AddAccessibilityElement(const _AccessibilityContainer& con
                _FastScrollIndex* pChildIndex = __pBaseIndex->GetChildIndex(i, true);
                SysTryReturnResult(NID_UI_CTRL, pChildIndex, GetLastResult(), "Failed to get the child index.");
 
-               int omittedCount = 0;
                if (pChildIndex->GetOmitted())
                {
-                       omittedCount = pChildIndex->GetChildCount();
-                       pChildIndex = __pBaseIndex->GetChildIndex(nonOmittedIndex, false);
+                       FloatPoint point((indexRect.x + indexRect.width/2), (indexRect.y + indexHeight/2));
+                       pChildIndex = GetOmissionIndexAtPoint(pChildIndex, point);
                        SysTryReturnResult(NID_UI_CTRL, pChildIndex, GetLastResult(), "Failed to get the child index.");
                }
 
@@ -713,17 +711,8 @@ _FastScrollIndexView::AddAccessibilityElement(const _AccessibilityContainer& con
                        SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to add accessibility element.", GetErrorMessage(r));
                }
 
-               if (omittedCount > 1)
-               {
-                       omittedCount--;
-               }
-               else
-               {
-                       indexRect.y += indexHeight;
-                       i++;
-               }
-
-               nonOmittedIndex++;
+               indexRect.y += indexHeight;
+               i++;
        }
 
        return E_SUCCESS;
@@ -843,32 +832,19 @@ _FastScrollIndexView::CalculateSelectedBg(void)
        }
        else
        {
-               if (selectedIndexOrder == 0)
+               selectedRect.y = ((selectedIndexOrder * indexHeight) + __viewConfig.__indexMarginTop);
+               if (indexHeight < __viewConfig.__selectedIndexHeight)
                {
-                       selectedRect.y = 0.0f;
-                       selectedRect.height = indexHeight + __viewConfig.__indexMarginTop;
-               }
-               else if (selectedIndexOrder == childCount - 1)
-               {
-                       selectedRect.y = ((selectedIndexOrder * indexHeight) + __viewConfig.__indexMarginTop);
-                       selectedRect.height = bounds.height - selectedRect.y;
+                       selectedRect.y -= ((__viewConfig.__selectedIndexHeight - indexHeight) / 2.0f);
                }
                else
                {
-                       selectedRect.y = ((selectedIndexOrder * indexHeight) + __viewConfig.__indexMarginTop);
-                       if (indexHeight < __viewConfig.__selectedIndexHeight)
-                       {
-                               selectedRect.y -= ((__viewConfig.__selectedIndexHeight - indexHeight) / 2.0f);
-                       }
-                       else
-                       {
-                               selectedRect.height = indexHeight;
-                       }
+                       selectedRect.height = indexHeight;
+               }
 
-                       if (selectedRect.y < 0.0f)
-                       {
-                               selectedRect.y = 0.0f;
-                       }
+               if (selectedRect.y < 0.0f)
+               {
+                       selectedRect.y = 0.0f;
                }
        }
 
@@ -1066,27 +1042,10 @@ _FastScrollIndexView::DrawSelectedIndex()
        FloatRectangle bounds = __pSelectedIndexVe->GetBounds();
        FloatRectangle outlineBounds = __pSelectedBgVe->GetBounds();
 
-       int childCount = __pBaseIndex->GetChildCount(__pBaseIndex->GetIndexType());
-       int selectedIndexOrder = GetSelectedIndexOrder();
-
        pCanvas->SetLineWidth(__viewConfig.__indexLeftLineThickness);
        pCanvas->SetForegroundColor(__viewConfig.__indexSelectedLineColor);
 
-       if (selectedIndexOrder == 0)
-       {
-               pCanvas->DrawLine(FloatPoint(0.0f, outlineBounds.height), FloatPoint(outlineBounds.width, outlineBounds.height));
-               pCanvas->DrawLine(FloatPoint(outlineBounds.width, outlineBounds.y), FloatPoint(outlineBounds.width, outlineBounds.height));
-
-               pCanvas->DrawLine(FloatPoint(1.0f, outlineBounds.height), FloatPoint(1.0f, bounds.height));
-       }
-       else if (selectedIndexOrder == childCount - 1)
-       {
-               pCanvas->DrawLine(FloatPoint(0.0f, outlineBounds.y), FloatPoint(outlineBounds.width, outlineBounds.y));
-               pCanvas->DrawLine(FloatPoint(outlineBounds.width, outlineBounds.y), FloatPoint(outlineBounds.width, bounds.height));
-
-               pCanvas->DrawLine(FloatPoint(1.0f, 0.0f), FloatPoint(1.0f, outlineBounds.y));
-       }
-       else if (__viewConfig.__pSelectedIndexlineBitmap)
+       if (__viewConfig.__pSelectedIndexlineBitmap)
        {
                Bitmap* pReplacementColorBackgroundBitmap = null;
                pReplacementColorBackgroundBitmap =