hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=37fa2ee7e6cb69d051e837aac99286c6f1433640

commit 37fa2ee7e6cb69d051e837aac99286c6f1433640
Author: Hermet Park <her...@hermet.pe.kr>
Date:   Mon Jun 6 12:33:17 2016 +0900

    live_edit: dismiss relative to ctxpopup only when esc key is pressed.
---
 src/bin/live_edit.c     | 24 +++++++++++++++++-------
 src/bin/main.c          | 16 ++++++++--------
 src/bin/tools.c         |  6 +++---
 src/include/live_edit.h |  2 +-
 4 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/src/bin/live_edit.c b/src/bin/live_edit.c
index 3ed1ae4..fe9908e 100644
--- a/src/bin/live_edit.c
+++ b/src/bin/live_edit.c
@@ -420,7 +420,7 @@ keygrabber_key_down_cb(void *data, Evas *e EINA_UNUSED,
    else if (strcmp(ev->key, "Delete") &&
             strcmp(ev->key, "BackSpace")) return;
 
-   live_edit_cancel();
+   live_edit_cancel(EINA_TRUE);
 }
 
 static void
@@ -2076,7 +2076,7 @@ layout_mouse_down_cb(void *data, Evas *e EINA_UNUSED, 
Evas_Object *obj,
    if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
      {
         live_edit_insert(ld);
-        live_edit_cancel();
+        live_edit_cancel(EINA_FALSE);
         return;
      }
 
@@ -2234,7 +2234,7 @@ static void
 live_btn_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
                     void *event_info EINA_UNUSED)
 {
-   live_edit_cancel();
+   live_edit_cancel(EINA_FALSE);
    goto_close();
    search_close();
 
@@ -2302,13 +2302,23 @@ live_edit_get(void)
 }
 
 Eina_Bool
-live_edit_cancel(void)
+live_edit_cancel(Eina_Bool phase_in)
 {
    live_data *ld = g_ld;
    if (!ld->on) return EINA_FALSE;
 
-   evas_object_del(ld->rel_to_info.ctxpopup);
-   ld->rel_to_info.ctxpopup = NULL;
+   //Dismiss Relative To Ctxpopup firstly.
+   if (phase_in && ld->rel_to_info.ctxpopup)
+     {
+        evas_object_del(ld->rel_to_info.ctxpopup);
+        ld->rel_to_info.ctxpopup = NULL;
+        return EINA_TRUE;
+     }
+   else
+     {
+        evas_object_del(ld->rel_to_info.ctxpopup);
+        ld->rel_to_info.ctxpopup = NULL;
+     }
 
    enventor_object_disabled_set(base_enventor_get(), EINA_FALSE);
 
@@ -2432,7 +2442,7 @@ void
 live_edit_term(void)
 {
    live_data *ld = g_ld;
-   live_edit_cancel();
+   live_edit_cancel(EINA_FALSE);
 
    free_auto_align_data(ld->auto_align_array);
    free(ld);
diff --git a/src/bin/main.c b/src/bin/main.c
index e7af536..e5e46f8 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -655,14 +655,14 @@ ctrl_func(Evas_Event_Key_Down *event)
    //Find/Replace
    if (!strcmp(event->key, "f") || !strcmp(event->key, "F"))
      {
-        live_edit_cancel();
+        live_edit_cancel(EINA_FALSE);
         search_open();
         return EINA_TRUE;
      }
    //Goto Line
    if (!strcmp(event->key, "l") || !strcmp(event->key, "L"))
      {
-        live_edit_cancel();
+        live_edit_cancel(EINA_FALSE);
         goto_open();
         return EINA_TRUE;
      }
@@ -723,7 +723,7 @@ keygrabber_key_down_cb(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED,
      {
         if (stats_ctxpopup_dismiss()) return;
 
-        if (live_edit_cancel())
+        if (live_edit_cancel(EINA_TRUE))
           {
              enventor_object_focus_set(base_enventor_get(), EINA_TRUE);
              return;
@@ -756,7 +756,7 @@ keygrabber_key_down_cb(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED,
    if (!strcmp(ev->key, "F1"))
      {
         enventor_object_ctxpopup_dismiss(base_enventor_get());
-        live_edit_cancel();
+        live_edit_cancel(EINA_FALSE);
         help_open();
         return;
      }
@@ -764,7 +764,7 @@ keygrabber_key_down_cb(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED,
    if (!strcmp(ev->key, "F2"))
      {
         enventor_object_ctxpopup_dismiss(base_enventor_get());
-        live_edit_cancel();
+        live_edit_cancel(EINA_FALSE);
         menu_edc_new(EINA_FALSE);
         return;
      }
@@ -772,7 +772,7 @@ keygrabber_key_down_cb(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED,
    if (!strcmp(ev->key, "F3"))
      {
         enventor_object_ctxpopup_dismiss(base_enventor_get());
-        live_edit_cancel();
+        live_edit_cancel(EINA_FALSE);
         menu_edc_save();
         return;
      }
@@ -780,7 +780,7 @@ keygrabber_key_down_cb(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED,
    if (!strcmp(ev->key, "F4"))
      {
         enventor_object_ctxpopup_dismiss(base_enventor_get());
-        live_edit_cancel();
+        live_edit_cancel(EINA_FALSE);
         menu_edc_load();
         return;
      }
@@ -822,7 +822,7 @@ keygrabber_key_down_cb(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED,
    //Setting
    if (!strcmp(ev->key, "F12"))
      {
-        live_edit_cancel();
+        live_edit_cancel(EINA_FALSE);
         enventor_object_ctxpopup_dismiss(base_enventor_get());
         menu_setting();
         return;
diff --git a/src/bin/tools.c b/src/bin/tools.c
index 5bf3e18..2cbc33e 100644
--- a/src/bin/tools.c
+++ b/src/bin/tools.c
@@ -28,7 +28,7 @@ static void
 menu_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
         void *event_info EINA_UNUSED)
 {
-   live_edit_cancel();
+   live_edit_cancel(EINA_FALSE);
    search_close();
    tools_goto_update();
 
@@ -95,7 +95,7 @@ static void
 find_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
         void *event_info EINA_UNUSED)
 {
-   live_edit_cancel();
+   live_edit_cancel(EINA_FALSE);
    if (search_close()) return;
    else search_open();
 }
@@ -104,7 +104,7 @@ static void
 goto_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
         void *event_info EINA_UNUSED)
 {
-   live_edit_cancel();
+   live_edit_cancel(EINA_FALSE);
    if (goto_close()) return;
    else goto_open();
 }
diff --git a/src/include/live_edit.h b/src/include/live_edit.h
index 5ff1299..2cb0c48 100644
--- a/src/include/live_edit.h
+++ b/src/include/live_edit.h
@@ -7,7 +7,7 @@
 
 Evas_Object *live_edit_init(Evas_Object *parent);
 void live_edit_term(void);
-Eina_Bool live_edit_cancel(void);
+Eina_Bool live_edit_cancel(Eina_Bool phase_in);
 Eina_Bool live_edit_get(void);
 void live_edit_update(void);
 Eina_List *live_edit_tools_create(Evas_Object *parent);

-- 


Reply via email to