okra pushed a commit to branch master.

http://git.enlightenment.org/tools/edi.git/commit/?id=05ee192b9824231ac7f0cecb6cf5f2bf426c66e0

commit 05ee192b9824231ac7f0cecb6cf5f2bf426c66e0
Author: Stephen 'Okra' Houston <[email protected]>
Date:   Fri Mar 3 18:08:40 2017 -0600

    Edi: Add double click expand/contract support on the file panel.
---
 AUTHORS                 |  7 ++++---
 src/bin/edi_filepanel.c | 13 +++++++++----
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 86b70eb..0c73ef4 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,6 +1,7 @@
-ajwillia.ms (Andy Williams) <[email protected]>
-wilsonk     (Kelly Wilson)  <[email protected]>
-YOhoho      (YeongJong Lee) <[email protected]>
+ajwillia.ms (Andy Williams)   <[email protected]>
+okra        (Stephen Houston) <[email protected]>
+wilsonk     (Kelly Wilson)    <[email protected]>
+YOhoho      (YeongJong Lee)   <[email protected]>
 
 Windows compatibility thanks to Vincent Torri <[email protected]>
 Icon created by The Rasterman (Carsten Haitzler) <[email protected]>
diff --git a/src/bin/edi_filepanel.c b/src/bin/edi_filepanel.c
index 705cd19..49cf909 100644
--- a/src/bin/edi_filepanel.c
+++ b/src/bin/edi_filepanel.c
@@ -161,16 +161,21 @@ static void
 _item_clicked_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj,
                  void *event_info)
 {
-   Evas_Event_Mouse_Down *ev;
+   Evas_Event_Mouse_Up *ev;
    Elm_Object_Item *it;
    Edi_Dir_Data *sd;
 
    ev = event_info;
-   if (ev->button != 3) return;
-
    it = elm_genlist_at_xy_item_get(obj, ev->output.x, ev->output.y, NULL);
    sd = elm_object_item_data_get(it);
 
+   if (ev->button == 1 && it)
+     {
+        if (ev->flags == EVAS_BUTTON_DOUBLE_CLICK && 
elm_genlist_item_type_get(it) == ELM_GENLIST_ITEM_TREE)
+          elm_genlist_item_expanded_set(it, 
!elm_genlist_item_expanded_get(it));
+     }
+   if (ev->button != 3) return;
+
    if (sd->isdir)
      return;
 
@@ -614,7 +619,7 @@ edi_filepanel_add(Evas_Object *parent, Evas_Object *win,
    elm_box_pack_end(box, list);
 
    _root_path = eina_stringshare_add(path);
-   evas_object_event_callback_add(list, EVAS_CALLBACK_MOUSE_DOWN,
+   evas_object_event_callback_add(list, EVAS_CALLBACK_MOUSE_UP,
                                   _item_clicked_cb, NULL);
    ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, 
(Ecore_Event_Handler_Cb)_file_listing_updated, _root_path);
    ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, 
(Ecore_Event_Handler_Cb)_file_listing_updated, _root_path);

-- 


Reply via email to