{
-static const int MAX_LIST_ITEM_COUNT = 3;
-
-
_FormDataWindow::_FormDataWindow(void)
: __pListView(null)
, __pWebView(null)
result r = layout.Construct(VERTICAL_DIRECTION_DOWNWARD);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- GET_SHAPE_CONFIG(CONTEXTMENU::LIST_ITEM_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, __listItemHeight);
+ GET_COLOR_CONFIG(LIST::ELEMENT_TEXT_NORMAL, __normalColor);
+ GET_COLOR_CONFIG(LIST::ELEMENT_TEXT_PRESSED, __pressedColor);
+ GET_COLOR_CONFIG(LIST::ELEMENT_TEXT_HIGHLIGHTED, __highlightedColor);
+
+ __listItemHeight = rect.height;
Rectangle windowRect(rect);
- windowRect.height = MAX_LIST_ITEM_COUNT*__listItemHeight;
r = Window::Construct(layout, windowRect, true, true);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Error Propogating.", GetErrorMessage(r));
result r = pItem->Construct(Dimension(itemWidth, __listItemHeight), LIST_ANNEX_STYLE_NORMAL);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
- r = pItem->AddElement(Rectangle(0, 0, itemWidth, __listItemHeight), ID_FORMAT_STRING, *pListElement, true);
+ int listItemHeight = 0;
+ int listItemTextSize = 0;
+ int listItemLeftMargin = 0;
+
+ GET_SHAPE_CONFIG(LIST::LIST_DEFAULT_ITEM_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, listItemHeight);
+ GET_SHAPE_CONFIG(LIST::LIST_ITEM_TEXT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, listItemTextSize);
+ GET_SHAPE_CONFIG(LIST::LIST_ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, listItemLeftMargin);
+
+ if (__listItemHeight > listItemHeight)
+ {
+ __listItemHeight = listItemHeight;
+ }
+
+ if (__listItemHeight*2/3 < listItemTextSize)
+ {
+ listItemTextSize = __listItemHeight*2/3;
+ }
+
+ Rectangle itemRect = Rectangle(listItemLeftMargin, 0, itemWidth, __listItemHeight);
+ r = pItem->AddElement(itemRect, ID_FORMAT_STRING, *pListElement, listItemTextSize, __normalColor, __pressedColor, __highlightedColor);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
return pItem.release();
__listElementArray.RemoveAll(true);
+ __listItemHeight = rect.height;
+
int itemCount = eina_list_count(pDataList);
for (int itemIndex = 0; itemIndex < itemCount; itemIndex++)
__pListView->UpdateList();
- Rectangle rec(rect);
- rec.height = (itemCount >= MAX_LIST_ITEM_COUNT) ? (MAX_LIST_ITEM_COUNT*__listItemHeight) : (itemCount*__listItemHeight);
- SetBounds(rec);
+ int windowHeight = itemCount*__listItemHeight;
+
+ Rectangle webRect = __pWebImpl->GetBounds();//is it better to take application rect
+ int bottomLimit = webRect.y + webRect.height;
+ int topLimit = webRect.y;
+ Rectangle windowRect(rect);
+
+ if (__pWebImpl->IsKeypadVisible())
+ {
+ Rectangle keyRect = __pWebImpl->GetPreviousKeypadBounds();
+ bottomLimit = keyRect.y;
+ }
+
+ int windowBottom = rect.y + windowHeight;
+
+ while (true)
+ {
+ if (windowBottom > bottomLimit)
+ {
+ int newWindowTop = rect.y - rect.height - windowHeight;
+ if (newWindowTop < topLimit)//check in reverse direction
+ {
+ if (--itemCount)
+ {
+ windowHeight = itemCount*__listItemHeight;
+ windowBottom = rect.y + windowHeight;
+ }
+ else
+ {
+ break;
+ }
+ }
+ else
+ {//reverse direction is good
+ windowRect.y = rect.y - rect.height - windowHeight;
+ break;
+ }
+ }
+ else
+ {
+ //rect is good
+ break;
+ }
+ }
+
+ windowRect.height = windowHeight;
+ __pListView->SetBounds(Rectangle(0, 0, windowRect.width, windowRect.height));
+ SetBounds(windowRect);
return E_SUCCESS;
}