summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyojung Jo <hj903.jo@samsung.com>2015-05-07 20:02:03 +0900
committerHyojung Jo <hj903.jo@samsung.com>2015-05-07 20:02:03 +0900
commitd916770c7ee46557619a214a60a4079265e58281 (patch)
treef6c4455f998d11c82a7bb57735374569fb089cc4
parent4a5eaede3cd46182bbfae34ce7f4a9e1a7f9e398 (diff)
downloadapplauncher-d916770c7ee46557619a214a60a4079265e58281.tar.gz
applauncher-d916770c7ee46557619a214a60a4079265e58281.tar.bz2
applauncher-d916770c7ee46557619a214a60a4079265e58281.zip
Move focus from menu btn to first thumbnail when right key pressed
Change-Id: I487183fa602ee831b107183415adc207b70d6b82 Signed-off-by: Hyojung Jo <hj903.jo@samsung.com>
-rw-r--r--include/AppsBaseLayout.h2
-rw-r--r--src/layout/AppsBaseLayout.cpp14
-rw-r--r--src/view/AppsBaseView.cpp22
3 files changed, 17 insertions, 21 deletions
diff --git a/include/AppsBaseLayout.h b/include/AppsBaseLayout.h
index e60a867..13122fa 100644
--- a/include/AppsBaseLayout.h
+++ b/include/AppsBaseLayout.h
@@ -72,7 +72,7 @@ public:
bool Create(CLayoutMgr *mgr, void *data);
virtual void Destroy(void);
- void Update(const char *currentMenu, ESortType sort_type);
+ void Update(Evas_Object *currentMenu, ESortType sort_type);
bool SetFocus(Eina_Bool flag);
void UpdateList(const char *pKey, const char *pValue);
diff --git a/src/layout/AppsBaseLayout.cpp b/src/layout/AppsBaseLayout.cpp
index e86706d..e6c0891 100644
--- a/src/layout/AppsBaseLayout.cpp
+++ b/src/layout/AppsBaseLayout.cpp
@@ -773,15 +773,25 @@ void CAppsBaseLayout::t_OnHide(void)
evas_object_hide(m->eoBase);
}
-void CAppsBaseLayout::Update(const char *currentMenu, ESortType sort_type)
+void CAppsBaseLayout::Update(Evas_Object *currentMenu, ESortType sort_type)
{
ASSERT(m);
ASSERT(currentMenu);
- m->currentMenu = strdup(currentMenu);
+ const char *currentMenuTxt = elm_object_text_get(currentMenu);
+
+ if (!currentMenuTxt) {
+ _ERR("Failed to get current menu text.");
+ return;
+ }
+
+ m->currentMenu = strdup(currentMenuTxt);
m->sort_type = sort_type;
m_LoadTableContents();
+
+ elm_object_focus_next_object_set(currentMenu, m->eoThumbFirst,
+ ELM_FOCUS_RIGHT);
}
bool CAppsBaseLayout::SetFocus(Eina_Bool flag)
diff --git a/src/view/AppsBaseView.cpp b/src/view/AppsBaseView.cpp
index 34d2744..04c1142 100644
--- a/src/view/AppsBaseView.cpp
+++ b/src/view/AppsBaseView.cpp
@@ -82,7 +82,7 @@ void CAppsBaseView::m_OnCtxPopupSelect(CContextPopup *instance, const char *text
m->sort_type = SORT_Z_TO_A;
elm_object_text_set(m->eoBtnSort, text);
- m->pAppsBaseLayout->Update(elm_object_text_get(m->eoBtnFocusedMenu), m->sort_type);
+ m->pAppsBaseLayout->Update(m->eoBtnFocusedMenu, m->sort_type);
}
void CAppsBaseView::m_MakeCtxpopup(void)
@@ -122,7 +122,7 @@ void CAppsBaseView::OnFocused(int id, Evas_Object *obj, Elm_Object_Item *item)
m->eoBtnFocusedMenu = obj;
- m->pAppsBaseLayout->Update(elm_object_text_get(m->eoBtnFocusedMenu), m->sort_type);
+ m->pAppsBaseLayout->Update(m->eoBtnFocusedMenu, m->sort_type);
break;
case EO_SORT_BTN:
@@ -177,20 +177,6 @@ void CAppsBaseView::OnSKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_SKe
void CAppsBaseView::OnSKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_SKey_Up *ev)
{
switch (id) {
- case EO_MENU:
- m->eoBtnFocusedMenu = obj;
-
- switch (ev->skey) {
- case SKEY_RIGHT:
- if (!m->pAppsBaseLayout->SetFocus(EINA_TRUE))
- elm_object_focus_set(m->eoBtnSort, EINA_TRUE);
- break;
-
- default:
- break;
- }
- break;
-
case EO_SORT_BTN:
switch (ev->skey) {
case SKEY_DOWN:
@@ -258,7 +244,7 @@ bool CAppsBaseView::m_DrawLeftSection(void)
evas_object_show(m->eoBtnMenu[i]);
Connect(m->eoBtnMenu[i], EO_MENU, TYPE_MOUSE_MOVE
- | TYPE_FOCUSED | TYPE_KEY_DOWN | TYPE_KEY_UP);
+ | TYPE_FOCUSED | TYPE_KEY_DOWN);
elm_object_focus_next_object_set(m->eoBtnMenu[i],
m->eoBtnMenu[i], ELM_FOCUS_LEFT);
@@ -312,7 +298,7 @@ bool CAppsBaseView::m_DrawFullView(void)
if (!m_DrawTopSection())
return false;
- m->pAppsBaseLayout->Update(elm_object_text_get(m->eoBtnFocusedMenu), m->sort_type);
+ m->pAppsBaseLayout->Update(m->eoBtnFocusedMenu, m->sort_type);
return true;
}