support to change value of zoombar by key event 24/38124/2
authorJehun Lim <jehun.lim@samsung.com>
Mon, 13 Apr 2015 11:01:01 +0000 (20:01 +0900)
committerJehun Lim <jehun.lim@samsung.com>
Mon, 13 Apr 2015 11:03:02 +0000 (20:03 +0900)
Change-Id: Ib3b2a7a0552096cdad9c361e2d8d39862873f09a
Signed-off-by: Jehun Lim <jehun.lim@samsung.com>
include/common/define.h
res/edc/views/zoom_view.edc
src/view/photo-viewer/zoom_view.cpp

index edf32ae..32312b0 100644 (file)
 #define SIG_CHANGED "changed"
 #define SIG_SHOW "show"
 #define SIG_HIDE "hide"
+#define SIG_FOCUS_ZOOMBAR "focus,zoombar"
+#define SIG_UNFOCUS_ZOOMBAR "unfocus,zoombar"
 #define SIG_MENU_SHOW "menu,show"
 #define SIG_MENU_SHOW_FINISH "menu,show,finish"
 #define SIG_MENU_HIDE "menu,hide"
index e4aa127..17f4695 100644 (file)
@@ -42,12 +42,16 @@ group {
                                rel2.relative, 0.0 0.0;
                                min, 140 110;
                                align, 0.0 0.0;
+                               color, 255 255 255 80;
+                       }
+                       description {
+                               state, "show" 0.0;
+                               inherit, "default" 0.0;
                                color, 255 255 255 255;
                        }
                        description {
                                state, "hide" 0.0;
                                inherit, "default" 0.0;
-                               color, 255 255 255 80;
                        }
                }
                part {
@@ -123,6 +127,12 @@ group {
                                rel2.to: PART_TEXT;
                                min: 100 200;
                                align: 0.5 0.0;
+                               color, 255 255 255 80;
+                       }
+                       description {
+                               state, "show" 0.0;
+                               inherit, "default" 0.0;
+                               color, 255 255 255 255;
                        }
                        description {
                                state, "hide" 0.0;
@@ -467,6 +477,22 @@ group {
                        }
                }
                program {
+                       name, "unfocus";
+                       signal, SIG_UNFOCUS_ZOOMBAR;
+                       source, "";
+                       action, STATE_SET "default" 0.0;
+                       target, "clip.rect";
+                       target, "clip.slider";
+               }
+               program {
+                       name, "focus";
+                       signal, SIG_FOCUS_ZOOMBAR;
+                       source, "";
+                       action, STATE_SET "show" 0.0;
+                       target, "clip.rect";
+                       target, "clip.slider";
+               }
+               program {
                        name, "uparrow_show";
                        signal, SIG_UPARROW_SHOW;
                        source, "";
index 016e048..df94ada 100644 (file)
@@ -39,7 +39,7 @@
 #define SLIDER_MIN_VALUE 0.1
 #define SLIDER_MAX_VALUE 4.0
 #define SLIDER_INIT_VALUE 2.0
-#define SLIDER_MOVE_SIZE 0.1
+#define SLIDER_MOVE_SIZE 0.025
 
 #define IMAGE_UPARROW IMAGEDIR"/ico_photozoom_arrow_up.png"
 #define IMAGE_DOWNARROW IMAGEDIR"/ico_photozoom_arrow_down.png"
@@ -332,9 +332,9 @@ bool CPhotoZoomView::m_DrawSlider(void)
 
        elm_object_part_content_set(m->eoBase, PART_SLIDER, m->eoSlider);
 
-       elm_object_focus_allow_set(m->eoSlider, EINA_FALSE);
+       evas_object_propagate_events_set(m->eoSlider, EINA_FALSE);
 
-       Connect(m->eoSlider, ZOOM_SLIDER, TYPE_CHANGED);
+       Connect(m->eoSlider, ZOOM_SLIDER, TYPE_KEY_DOWN | TYPE_CHANGED);
 
        return true;
 }
@@ -618,7 +618,13 @@ void CPhotoZoomView::m_ViewKeyDown(Evas_Event_Key_Down *ev)
 
        m->updated = EINA_FALSE;
 
-       if (!strcmp(ev->keyname, KEY_BACK) ||
+       if (!strcmp(ev->keyname, KEY_ENTER) ||
+               !strcmp(ev->keyname, KEY_ENTER_REMOTE)) {
+               elm_object_focus_set(m->eoPhotocam, EINA_FALSE);
+               elm_object_focus_set(m->eoSlider, EINA_TRUE);
+
+               elm_object_signal_emit(m->eoBase, SIG_FOCUS_ZOOMBAR, "");
+       } else if (!strcmp(ev->keyname, KEY_BACK) ||
                !strcmp(ev->keyname, KEY_BACK_REMOTE)) {
                CViewMgr::GetInstance()->PopView();
                return;
@@ -637,6 +643,17 @@ void CPhotoZoomView::OnKeyDown(int id, Evas *e, Evas_Object *obj,
        case ZOOM_VIEW:
                m_ViewKeyDown(ev);
                break;
+       case ZOOM_SLIDER:
+               if (!strcmp(ev->keyname, KEY_ENTER)
+                       || !strcmp(ev->keyname, KEY_ENTER_REMOTE)
+                       || !strcmp(ev->keyname, KEY_BACK)
+                       || !strcmp(ev->keyname, KEY_BACK_REMOTE)) {
+                       elm_object_focus_set(m->eoSlider, EINA_FALSE);
+                       elm_object_focus_set(m->eoPhotocam, EINA_TRUE);
+
+                       elm_object_signal_emit(m->eoBase, SIG_UNFOCUS_ZOOMBAR, "");
+               }
+               break;
        default:
                break;
        }
@@ -753,6 +770,11 @@ void CPhotoZoomView::OnTimeout(void)
 {
        elm_object_signal_emit(m->eoBase, SIG_HIDE, "");
 
+       if (elm_object_focus_get(m->eoSlider)) {
+               elm_object_focus_set(m->eoSlider, EINA_FALSE);
+               elm_object_focus_set(m->eoPhotocam, EINA_TRUE);
+       }
+
        m->timeout = EINA_TRUE;
 
        evas_object_freeze_events_set(m->eoPhotocam, EINA_TRUE);