okra pushed a commit to branch master.

http://git.enlightenment.org/apps/ephoto.git/commit/?id=81eb801c31f62d127e7377c20d6b9b05c185fa62

commit 81eb801c31f62d127e7377c20d6b9b05c185fa62
Author: Stephen okra Houston <[email protected]>
Date:   Mon Aug 29 14:33:20 2016 -0500

    Ephoto: Select and bring in the current item when going from single view to 
thumb view.
---
 src/bin/ephoto.h               |  1 +
 src/bin/ephoto_main.c          | 18 +++++++++++++++---
 src/bin/ephoto_thumb_browser.c |  7 ++++++-
 3 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/src/bin/ephoto.h b/src/bin/ephoto.h
index 590bfba..f4795e2 100644
--- a/src/bin/ephoto.h
+++ b/src/bin/ephoto.h
@@ -321,6 +321,7 @@ struct _Ephoto_Entry
    Eina_Bool is_link;
    Eina_Bool no_delete;
    Evas_Object *genlist;
+   Evas_Object *gengrid;
    Evas_Object *thumb;
 };
 
diff --git a/src/bin/ephoto_main.c b/src/bin/ephoto_main.c
index a3702b9..e7bb39d 100644
--- a/src/bin/ephoto_main.c
+++ b/src/bin/ephoto_main.c
@@ -35,8 +35,6 @@ _ephoto_state_set(Ephoto *ephoto, Ephoto_State state)
 static void
 _ephoto_thumb_browser_show(Ephoto *ephoto, Ephoto_Entry *entry)
 {
-   ephoto_single_browser_entry_set(ephoto->single_browser, NULL);
-   ephoto_slideshow_entry_set(ephoto->slideshow, NULL);
    elm_naviframe_item_promote(ephoto->tb);
    elm_object_focus_set(ephoto->thumb_browser, EINA_TRUE);
    _ephoto_state_set(ephoto, EPHOTO_STATE_THUMB);
@@ -55,7 +53,21 @@ _ephoto_thumb_browser_show(Ephoto *ephoto, Ephoto_Entry 
*entry)
    evas_object_freeze_events_set(ephoto->slideshow, EINA_TRUE);
    evas_object_freeze_events_set(ephoto->thumb_browser, EINA_FALSE);
    if ((entry) && (entry->item))
-     elm_gengrid_item_bring_in(entry->item, ELM_GENGRID_ITEM_SCROLLTO_IN);
+     {
+        Eina_List *l;
+        Elm_Object_Item *it;
+
+        l = eina_list_clone(elm_gengrid_selected_items_get(entry->gengrid));
+        if (eina_list_count(l) <= 1)
+          {
+             EINA_LIST_FREE(l, it)
+               elm_gengrid_item_selected_set(it, EINA_FALSE);
+             elm_gengrid_item_bring_in(entry->item, 
ELM_GENGRID_ITEM_SCROLLTO_IN);
+             elm_gengrid_item_selected_set(entry->item, EINA_TRUE);
+          }
+     }
+   ephoto_single_browser_entry_set(ephoto->single_browser, NULL);
+   ephoto_slideshow_entry_set(ephoto->slideshow, NULL);
 }
 
 static void
diff --git a/src/bin/ephoto_thumb_browser.c b/src/bin/ephoto_thumb_browser.c
index 6a0243c..d643ed6 100644
--- a/src/bin/ephoto_thumb_browser.c
+++ b/src/bin/ephoto_thumb_browser.c
@@ -1345,6 +1345,8 @@ _todo_items_process(void *data)
         {
           const Elm_Gengrid_Item_Class *ic;
 
+           entry->gengrid = tb->grid;
+
           ic = &_ephoto_thumb_file_class;
            if (tb->sort == EPHOTO_SORT_ALPHABETICAL_ASCENDING)
             entry->item =
@@ -1365,10 +1367,11 @@ _todo_items_process(void *data)
            else if (tb->sort == EPHOTO_SORT_SIMILARITY)
              entry->thumb =
                  ephoto_thumb_add(entry->ephoto, tb->grid, entry);
-                
+
           if (entry->item)
             {
                elm_object_item_data_set(entry->item, entry);
+
              }
            else if (tb->sort != EPHOTO_SORT_SIMILARITY)
             {
@@ -1845,6 +1848,8 @@ ephoto_thumb_browser_insert(Ephoto *ephoto, Ephoto_Entry 
*entry)
         tb->totsize += (double) entry->size;
         eina_file_close(f);
 
+        entry->gengrid = tb->grid;
+
         ic = &_ephoto_thumb_file_class;
         if (tb->sort == EPHOTO_SORT_ALPHABETICAL_ASCENDING)
           entry->item =

-- 


Reply via email to