return false - KeyPress;\7f
[apps/osp/Gallery.git] / src / GlSlideShowPopUp.cpp
index f178ff4..ca4af7b 100644 (file)
@@ -2,11 +2,11 @@
 // Tizen Native SDK
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Flora License, Version 1.1 (the License);
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
-//     http://www.tizenopensource.org/license
+//     http://floralicense.org/license/
 //
 // Unless required by applicable law or agreed to in writing, software
 // distributed under the License is distributed on an AS IS BASIS,
@@ -20,7 +20,6 @@
  * @brief      This file contains the definitions of the SlideShowPopUp class.
  */
 
-#include <FAppUiApp.h>
 #include <FUiScenes.h>
 
 #include "GlResourceManager.h"
@@ -54,6 +53,7 @@ SlideShowPopUp::Initialize(void)
 {
        Button* pCancelButton = null;
        Popup::Construct(L"IDL_SLIDESHOW_SETTING_POPUP");
+       Popup::SetPropagatedKeyEventListener(this);
 
        __pList = static_cast<ListView*>(GetControl(L"IDC_POPUP_LIST"));
 
@@ -65,7 +65,7 @@ SlideShowPopUp::Initialize(void)
        __pList->SetItemProvider(*this);
        __pList->AddListViewItemEventListener(*this);
 
-       pCancelButton = static_cast< Button* >(GetControl(L"IDC_BUTTON", true));
+       pCancelButton = static_cast<Button*>(GetControl(L"IDC_BUTTON", true));
 
        if (pCancelButton != null)
        {
@@ -93,6 +93,7 @@ SlideShowPopUp::OnActionPerformed(const Control& source, int actionId)
                Popup::Show();
        }
        break;
+
        default:
                break;
        }
@@ -108,6 +109,19 @@ SlideShowPopUp::OnListViewItemStateChanged(ListView& listView, int index, int el
        }
 }
 
+bool
+SlideShowPopUp::OnKeyReleased(Control& source, const Tizen::Ui::KeyEventInfo& keyEventInfo)
+{
+       AppLogDebug("ENTER");
+
+       if(keyEventInfo.GetKeyCode() == KEY_BACK)
+       {
+               Popup::SetShowState(false);
+               Popup::Show();
+       }
+       return false;
+}
+
 ListItemBase*
 SlideShowPopUp::CreateItem(int index, int itemWidth)
 {
@@ -128,14 +142,14 @@ SlideShowPopUp::CreateItem(int index, int itemWidth)
        {
        case 0:
        {
-               pItem->AddElement(Rectangle(0, 0, GetClientAreaBounds().width, listItemHeight), ID_FORMAT_START,
+               pItem->AddElement(Rectangle(25, 0, GetClientAreaBounds().width, listItemHeight), ID_FORMAT_START,
                                ResourceManager::GetString(L"IDS_MEDIABR_OPT_START_SLIDESHOW"), true);
        }
        break;
 
        case 1:
        {
-               pItem->AddElement(Rectangle(0, 0, GetClientAreaBounds().width, listItemHeight), ID_FORMAT_SETTING,
+               pItem->AddElement(Rectangle(25, 0, GetClientAreaBounds().width, listItemHeight), ID_FORMAT_SETTING,
                                ResourceManager::GetString(L"IDS_MEDIABR_BODY_SLIDESHOW_SETTINGS"), true);
        }
        break;