From: jyothi kumar sambolu Date: Tue, 30 Apr 2013 12:45:34 +0000 (+0530) Subject: 37072: Adjust selectbox height based on number of listview items X-Git-Tag: submit/tizen_2.1/20130514.054703~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad8f99095e26d4a69116c90297e2bd847d9c75e9;p=framework%2Fosp%2Fweb.git 37072: Adjust selectbox height based on number of listview items Change-Id: Ia9b73322705d5ad21f514b0b3e72fdb410a428e5 Signed-off-by: jyothi kumar sambolu --- diff --git a/src/controls/FWebCtrl_SelectBox.cpp b/src/controls/FWebCtrl_SelectBox.cpp index 07c172b..ae8448c 100755 --- a/src/controls/FWebCtrl_SelectBox.cpp +++ b/src/controls/FWebCtrl_SelectBox.cpp @@ -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; diff --git a/src/controls/FWebCtrl_WebImpl.cpp b/src/controls/FWebCtrl_WebImpl.cpp index 611a5a0..f01cf0d 100755 --- a/src/controls/FWebCtrl_WebImpl.cpp +++ b/src/controls/FWebCtrl_WebImpl.cpp @@ -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);