Fixed Nabi Issues N_SE-56966,56735
[apps/osp/Internet.git] / src / IntDropDownCustomItem.cpp
index 17c10c6..46b51ec 100644 (file)
@@ -24,6 +24,7 @@
 #include <FApp.h>
 #include <FUiControls.h>
 
+#include "IntCommonLib.h"
 #include "IntDropDownCustomItem.h"
 #include "IntTypes.h"
 
@@ -32,10 +33,10 @@ using namespace Tizen::Base;
 using namespace Tizen::Graphics;
 using namespace Tizen::Ui::Controls;
 
-static const wchar_t* IDB_LIST_EXPAND_CLOSED = L"00_circle_button_Expand_closed.png";
-static const wchar_t* IDB_LIST_EXPAND_CLOSED_PRESS = L"00_list_expand_closed_press.png";
-static const wchar_t* IDB_LIST_EXPAND_OPENED = L"00_circle_button_Expand_open.png";
-static const wchar_t* IDB_LIST_EXPAND_OPENED_PRESS = L"00_list_expand_opened_press.png";
+static const wchar_t* IDB_LIST_EXPAND_CLOSED = L"00_button_expand_closed.png";
+static const wchar_t* IDB_LIST_EXPAND_CLOSED_PRESS = L"00_button_expand_closed_press.png";
+static const wchar_t* IDB_LIST_EXPAND_OPENED = L"00_button_expand_opened.png";
+static const wchar_t* IDB_LIST_EXPAND_OPENED_PRESS = L"00_button_expand_opened_press.png";
 
 const int DropDownCustomItem::IDA_FORMAT_BITMAP = 101;
 const int DropDownCustomItem::IDA_FORMAT_MAIN_STRING = 102;
@@ -62,7 +63,8 @@ DropDownCustomItem::Construct(int width)
 {
        result r = E_SUCCESS;
        __width = width;
-       __height = 140;
+       __fontSize = CommonUtil::GetFontSize();
+       __height = 140 + (__fontSize - 44);
        Dimension dim(__width, __height);
        r = CustomItem::Construct(dim, LIST_ANNEX_STYLE_NORMAL);
        return r;
@@ -107,7 +109,7 @@ DropDownCustomItem::Make()
        Tizen::Graphics::Bitmap* pDropperBitmapPressed = null;
 
        pMainEnText = new(std::nothrow) EnrichedText();
-       r = pMainEnText->Construct(Dimension(__width - 80, 54));
+       r = pMainEnText->Construct(Dimension(__width - 80, 54 + (__fontSize - 44)));
        if(IsFailed(r))
        {
                delete pMainEnText;
@@ -117,7 +119,7 @@ DropDownCustomItem::Make()
        pMainTextElement = new(std::nothrow) TextElement();
        pMainTextElement->Construct(__mainText);
 
-       mainTextFont.Construct(FONT_STYLE_BOLD, 44);
+       mainTextFont.Construct(FONT_STYLE_BOLD, __fontSize);
 
        Color pressedTextColor = CUSTOM_COLOR_LISTVIEW_TEXT;
        pMainTextElement->SetFont(mainTextFont);
@@ -135,7 +137,15 @@ DropDownCustomItem::Make()
        }
 
        pSubTextElement = new(std::nothrow) TextElement();
-       pSubTextElement->Construct(__subText);
+       r = pSubTextElement->Construct(__subText);
+       if(IsFailed(r))
+       {
+               pMainEnText->RemoveAll(true);
+               delete pMainEnText;
+               delete pSubEnText;
+               delete pSubTextElement;
+               return E_FAILURE;
+       }
 
 
        subTextFont.Construct(FONT_STYLE_PLAIN, 32);
@@ -144,8 +154,8 @@ DropDownCustomItem::Make()
        pSubTextElement->SetTextColor(CUSTOM_COLOR_GREY);
        pSubEnText->Add(*pSubTextElement);
 
-       r = AddElement(Rectangle(26, 22, __width - 126, 54), IDA_FORMAT_MAIN_STRING, *pMainEnText);
-       r = AddElement(Rectangle(26, 76, __width - 126, 42), IDA_FORMAT_SUB_STRING, *pSubEnText);
+       r = AddElement(Rectangle(26, 22, __width - 126, 72 + (__fontSize - 44)), IDA_FORMAT_MAIN_STRING, *pMainEnText);
+       r = AddElement(Rectangle(26, 76 + (__fontSize - 44), __width - 126, 42), IDA_FORMAT_SUB_STRING, *pSubEnText);
        if(IsFailed(r))
        {
                pMainEnText->RemoveAll(true);
@@ -168,7 +178,7 @@ DropDownCustomItem::Make()
                        pDropperBitmapPressed = pAppResource->GetBitmapN(IDB_LIST_EXPAND_OPENED_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888);
                }
 
-               AddElement(Rectangle(__width - pDropperBitmapNormal->GetWidth() - 12, (__height - 74) / 2, 74, 74), IDA_FORMAT_DROPPER, *pDropperBitmapNormal, pDropperBitmapNormal, pDropperBitmapNormal);
+               AddElement(Rectangle(__width - pDropperBitmapNormal->GetWidth() - 12, (__height - pDropperBitmapNormal->GetHeight()) / 2 +  (__fontSize - 44)/2, pDropperBitmapNormal->GetWidth(), pDropperBitmapNormal->GetHeight()), IDA_FORMAT_DROPPER, *pDropperBitmapNormal, pDropperBitmapNormal, pDropperBitmapNormal);
                delete pDropperBitmapNormal;
                delete pDropperBitmapPressed;
        }