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 =