Fixed issue 45087
[apps/osp/Gallery.git] / src / GlAlbumListEditorForm.cpp
index 82e9127..1d59c9b 100644 (file)
@@ -191,6 +191,7 @@ AlbumListEditorForm::InitializePopup(void)
        {
                __pDeletePopup = new (std::nothrow) Popup();
                __pDeletePopup->Construct(false, Dimension(W_DELETE_POPUP, H_DELETE_POPUP));
+               __pDeletePopup->SetPropagatedKeyEventListener(this);
 
                Rectangle popupClientBounds = __pDeletePopup->GetClientAreaBounds();
 
@@ -257,7 +258,7 @@ AlbumListEditorForm::CreateIconListView(void)
 
        __pEditorFolderIconList->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
 
-       AddControl(*__pEditorFolderIconList);
+       AddControl(__pEditorFolderIconList);
 
        __pEditorFolderIconList->SetShowState(true);
 
@@ -283,8 +284,8 @@ AlbumListEditorForm::CreateItem(int index)
        Bitmap* pBitmapRenameBg = null;
        Bitmap* pBitmapRename = null;
        String albumName ;
-       int canvasWidth = 64;
-       int canvasHeight = 64;
+       int canvasWidth = 75;
+       int canvasHeight = 75;
 
        IconListViewItem* pIconListviewItem = new (std::nothrow) IconListViewItem();
 
@@ -335,8 +336,8 @@ AlbumListEditorForm::CreateItem(int index)
 
                pEditAlbumCanvas = new (std::nothrow) Canvas();
                pEditAlbumCanvas->Construct(Rectangle(0, 0, canvasWidth, canvasHeight));
-               pEditAlbumCanvas->DrawBitmap(Point(0, 0), *pBitmapRenameBg);
-               pEditAlbumCanvas->DrawBitmap(Point(0, 0), *pBitmapRename);
+               pEditAlbumCanvas->DrawBitmap(Point(0, 6), *pBitmapRenameBg);
+               pEditAlbumCanvas->DrawBitmap(Point(0, 6), *pBitmapRename);
 
 
                pEditAlbumBitmap = new (std::nothrow) Bitmap();
@@ -344,8 +345,9 @@ AlbumListEditorForm::CreateItem(int index)
                if (pEditAlbumBitmap != NULL)
                {
                        pEditAlbumBitmap->Construct(*pEditAlbumCanvas, Rectangle(0, 0, canvasWidth, canvasHeight));
-                       delete pEditAlbumCanvas;
+
                }
+               delete pEditAlbumCanvas;
 
                albumName = pAlbumInfo->GetAlbumName();
                String reservedCameraName = ResourceManager::GetString(L"IDS_MEDIABR_BODY_CAMERA_ROLL_ABB");
@@ -369,6 +371,15 @@ AlbumListEditorForm::CreateItem(int index)
                }
        }
 
+       if (pBitmapRenameBg)
+       {
+               delete pBitmapRenameBg;
+       }
+       if (pBitmapRename)
+       {
+               delete pBitmapRename;
+       }
+
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
        return pIconListviewItem;
@@ -608,8 +619,8 @@ AlbumListEditorForm::OnActionPerformed(const Control& source, int actionId)
                 __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
                                IDA_CONTEXT_MENU_MESSAGE);
                __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"), IDA_CONTEXT_MENU_EMAIL);
+               __pShareContextMenu->SetFocusable(true);
                __pShareContextMenu->AddActionEventListener(*this);
-
                __pShareContextMenu->SetShowState(true);
                __pShareContextMenu->Show();
        }
@@ -757,6 +768,20 @@ void AlbumListEditorForm::OnFileOpComplete(enum FileActionMode actionId, enum Fi
        SceneManager* pSceneManager = SceneManager::GetInstance();
        AppAssert(pSceneManager);
        pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
+       AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+}
+
+bool AlbumListEditorForm::OnKeyReleased(Control& source, const Tizen::Ui::KeyEventInfo& keyEventInfo)
+{
+       AppLogDebug("ENTER");
+
+       if(keyEventInfo.GetKeyCode() == KEY_BACK)
+       {
+               __pDeletePopup->SetShowState(false);
+               __pDeletePopup->Show();
+       }
+       AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+       return false;
 }
 
 result
@@ -1007,7 +1032,7 @@ AlbumListEditorForm::OnOrientationChanged(const Tizen::Ui::Control &source, Tize
        __pEditorFolderIconList->SetItemBorderStyle(ICON_LIST_VIEW_ITEM_BORDER_STYLE_NONE);
        __pEditorFolderIconList->AddIconListViewItemEventListener(*this);
 
-       AddControl(*__pEditorFolderIconList);
+       AddControl(__pEditorFolderIconList);
 
        int loopCount = pIndexList->GetCount();
        int index = -1 ;