37072: Adjust selectbox height based on number of listview items
authorjyothi kumar sambolu <s.jyothi@samsung.com>
Tue, 30 Apr 2013 12:45:34 +0000 (18:15 +0530)
committerjyothi kumar sambolu <s.jyothi@samsung.com>
Tue, 30 Apr 2013 12:45:34 +0000 (18:15 +0530)
Change-Id: Ia9b73322705d5ad21f514b0b3e72fdb410a428e5
Signed-off-by: jyothi kumar sambolu <s.jyothi@samsung.com>
src/controls/FWebCtrl_SelectBox.cpp
src/controls/FWebCtrl_WebImpl.cpp

index 07c172b..ae8448c 100755 (executable)
@@ -142,12 +142,11 @@ _SelectBox::~_SelectBox(void)
 
 
 result
-_SelectBox::Construct(bool isMultiSelect, const String& title, int listItemCnt, Evas_Object* pWebView)
+_SelectBox::Construct(bool isMultiSelect, const String& title, int listCount, Evas_Object* pWebView)
 {
        result r = E_SUCCESS;
        Rectangle rect;
 
-       int listCount = 4;
        int listItemHeight = 0;
        int listMaxHeihgt = 0;
        int popupWinTopMargin = 0;
@@ -167,7 +166,7 @@ _SelectBox::Construct(bool isMultiSelect, const String& title, int listItemCnt,
 
        listMaxHeihgt = listCount * listItemHeight + pPopupData->btnDim.height + 2 * ( pPopupData->spacePad + popupWinTopMargin + popupWinBottomMargin);
 
-       rect.height = Max< int >(listMaxHeihgt, pPopupData->popupDim.height);
+       rect.height = listMaxHeihgt;
        rect.width = pPopupData->popupDim.width;
        rect.x = 0;
        rect.y = 0;
index 611a5a0..f01cf0d 100755 (executable)
@@ -144,6 +144,7 @@ static const int MAX_TEXT_MATCH = pow(2, 31) - 1;
 
 static const int PORTRAIT_KEYPAD_HEIGHT = 444;
 static const int LANDSCAPE_KEYPAD_HEIGHT = 316;
+static const int DEFAULT_LIST_ITEM_COUNT = 4;
 
 
 Eina_Bool
@@ -2300,15 +2301,14 @@ _WebImpl::ShowSelectBoxPopup(bool isMultiSelect, const String& title, Eina_List*
 {
        __pSelectBox.reset();
 
-       int itemCount = eina_list_count(pItems);
-       SysTryReturnResult(NID_WEB_CTRL, itemCount > 0, E_SYSTEM, "ItemCount is invalid.");
+       SysTryReturnResult(NID_WEB_CTRL, eina_list_count(pItems) > 0, E_SYSTEM, "ItemCount is invalid.");
 
        result r = E_SUCCESS;
 
        std::unique_ptr<_SelectBox> pSelectBox(new (std::nothrow) _SelectBox());
        SysTryReturnResult(NID_WEB_CTRL, pSelectBox.get(), E_OUT_OF_MEMORY, "Memory allocation failed.");
 
-       r = pSelectBox->Construct(isMultiSelect, title, itemCount, pWebView);
+       r = pSelectBox->Construct(isMultiSelect, title, DEFAULT_LIST_ITEM_COUNT, pWebView);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        r = pSelectBox->UpdateList(pItems, selectedIndex, false, false);