diff --git a/src/bin/ephoto.h b/src/bin/ephoto.h index 8e69c1b..dc62990 100644 --- a/src/bin/ephoto.h +++ b/src/bin/ephoto.h @@ -270,6 +270,7 @@ struct _Ephoto Evas_Object *file_popup; Eina_Bool folders_toggle; + Eina_Bool thumb_browser_dirty; Eina_List *entries; Eina_List *selentries; Eina_List *searchentries; diff --git a/src/bin/ephoto_config.c b/src/bin/ephoto_config.c index 56aa1f3..779c625 100644 --- a/src/bin/ephoto_config.c +++ b/src/bin/ephoto_config.c @@ -65,6 +65,8 @@ _config_save_cb(void *data, Evas_Object *obj EINA_UNUSED, elm_object_focus_set(ephoto->pager, EINA_TRUE); if (ephoto->state == EPHOTO_STATE_THUMB) ephoto_thumb_browser_recalc(ephoto); + else + ephoto->thumb_browser_dirty = EINA_TRUE; } static void diff --git a/src/bin/ephoto_main.c b/src/bin/ephoto_main.c index b8c0054..4bb25aa 100644 --- a/src/bin/ephoto_main.c +++ b/src/bin/ephoto_main.c @@ -49,7 +49,7 @@ _ephoto_thumb_browser_show(Ephoto *ephoto, Ephoto_Entry *entry) evas_object_freeze_events_set(ephoto->single_browser, EINA_TRUE); evas_object_freeze_events_set(ephoto->slideshow, EINA_TRUE); evas_object_freeze_events_set(ephoto->thumb_browser, EINA_FALSE); - if ((entry) && (entry->item)) + if ((entry) && (entry->item) && (!ephoto->thumb_browser_dirty)) { Eina_List *l; Elm_Object_Item *it; @@ -63,6 +63,8 @@ _ephoto_thumb_browser_show(Ephoto *ephoto, Ephoto_Entry *entry) elm_gengrid_item_selected_set(entry->item, EINA_TRUE); } } + else + ephoto_thumb_browser_recalc(ephoto); ephoto_single_browser_entry_set(ephoto->single_browser, NULL); ephoto_slideshow_entry_set(ephoto->slideshow, NULL); } @@ -370,6 +372,7 @@ ephoto_window_add(const char *path) ephoto->selentries = NULL; ephoto->folders_toggle = EINA_FALSE; + ephoto->thumb_browser_dirty = EINA_FALSE; ephoto->entries = NULL; ephoto->sort = EPHOTO_SORT_ALPHABETICAL_ASCENDING; ephoto->win = elm_win_util_standard_add("ephoto", "Ephoto"); diff --git a/src/bin/ephoto_thumb_browser.c b/src/bin/ephoto_thumb_browser.c index b7073b7..c5be268 100644 --- a/src/bin/ephoto_thumb_browser.c +++ b/src/bin/ephoto_thumb_browser.c @@ -1917,6 +1917,7 @@ ephoto_thumb_browser_recalc(Ephoto *ephoto) ephoto_thumb_browser_clear(ephoto); ephoto_directory_set(ephoto, ephoto->config->directory, NULL, 0, 1); + ephoto->thumb_browser_dirty = EINA_FALSE; } void