Hid the popups when Esc key is pressed
[apps/osp/Gallery.git] / src / GlAlbumListEditorForm.cpp
index 6cded72..55530cd 100644 (file)
@@ -202,8 +202,7 @@ AlbumListEditorForm::InitializePopup(void)
                pLabel->SetTextConfig(34,LABEL_TEXT_STYLE_BOLD);
 
                Button* pDeleteButton = new (std::nothrow) Button();
-               pDeleteButton->Construct(
-                               Rectangle(10, Y_DELETE_BUTTON, popupClientBounds.width / 2 - GAP_W_POPUP_ITEM -10, H_DELETE_BUTTON),
+               pDeleteButton->Construct(Rectangle(popupClientBounds.width / 2 + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON,     popupClientBounds.width / 2 - GAP_W_POPUP_ITEM -10, H_DELETE_BUTTON),
                                ResourceManager::GetString(L"IDS_COM_BODY_DELETE"));
                pDeleteButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_DELETE_BUTTON_NORMAL);
                pDeleteButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_DELETE_BUTTON_PRESSED);
@@ -212,10 +211,8 @@ AlbumListEditorForm::InitializePopup(void)
                pDeleteButton->AddActionEventListener(*this);
 
                Button* pCancelButton = new (std::nothrow) Button();
-               pCancelButton->Construct(
-                               Rectangle(popupClientBounds.width / 2 + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON,
-                                               popupClientBounds.width / 2 - GAP_W_POPUP_ITEM -10, H_DELETE_BUTTON),
-                                               ResourceManager::GetString(L"IDS_COM_POP_CANCEL"));
+               pCancelButton->Construct(Rectangle(10, Y_DELETE_BUTTON, popupClientBounds.width / 2 - GAP_W_POPUP_ITEM -10, H_DELETE_BUTTON),
+                               ResourceManager::GetString(L"IDS_COM_POP_CANCEL"));
                pCancelButton->SetActionId(IDA_DELETE_POPUP_CANCEL);
                pCancelButton->AddActionEventListener(*this);
 
@@ -775,7 +772,7 @@ bool AlbumListEditorForm::OnKeyReleased(Control& source, const Tizen::Ui::KeyEve
 {
        AppLogDebug("ENTER");
 
-       if (keyEventInfo.GetKeyCode() == KEY_BACK)
+       if (keyEventInfo.GetKeyCode() == KEY_BACK || keyEventInfo.GetKeyCode() == KEY_ESC)
        {
                __pDeletePopup->SetShowState(false);
                __pDeletePopup->Show();