Set thumb browser dirty to change if it is not visible.

This commit is contained in:
Stephen Houston 2017-10-02 14:03:52 -05:00
parent 18bc0792aa
commit 93fd99ae03
4 changed files with 8 additions and 1 deletions

View File

@ -270,6 +270,7 @@ struct _Ephoto
Evas_Object *file_popup; Evas_Object *file_popup;
Eina_Bool folders_toggle; Eina_Bool folders_toggle;
Eina_Bool thumb_browser_dirty;
Eina_List *entries; Eina_List *entries;
Eina_List *selentries; Eina_List *selentries;
Eina_List *searchentries; Eina_List *searchentries;

View File

@ -65,6 +65,8 @@ _config_save_cb(void *data, Evas_Object *obj EINA_UNUSED,
elm_object_focus_set(ephoto->pager, EINA_TRUE); elm_object_focus_set(ephoto->pager, EINA_TRUE);
if (ephoto->state == EPHOTO_STATE_THUMB) if (ephoto->state == EPHOTO_STATE_THUMB)
ephoto_thumb_browser_recalc(ephoto); ephoto_thumb_browser_recalc(ephoto);
else
ephoto->thumb_browser_dirty = EINA_TRUE;
} }
static void static void

View File

@ -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->single_browser, EINA_TRUE);
evas_object_freeze_events_set(ephoto->slideshow, EINA_TRUE); evas_object_freeze_events_set(ephoto->slideshow, EINA_TRUE);
evas_object_freeze_events_set(ephoto->thumb_browser, EINA_FALSE); 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; Eina_List *l;
Elm_Object_Item *it; 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); 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_single_browser_entry_set(ephoto->single_browser, NULL);
ephoto_slideshow_entry_set(ephoto->slideshow, NULL); ephoto_slideshow_entry_set(ephoto->slideshow, NULL);
} }
@ -370,6 +372,7 @@ ephoto_window_add(const char *path)
ephoto->selentries = NULL; ephoto->selentries = NULL;
ephoto->folders_toggle = EINA_FALSE; ephoto->folders_toggle = EINA_FALSE;
ephoto->thumb_browser_dirty = EINA_FALSE;
ephoto->entries = NULL; ephoto->entries = NULL;
ephoto->sort = EPHOTO_SORT_ALPHABETICAL_ASCENDING; ephoto->sort = EPHOTO_SORT_ALPHABETICAL_ASCENDING;
ephoto->win = elm_win_util_standard_add("ephoto", "Ephoto"); ephoto->win = elm_win_util_standard_add("ephoto", "Ephoto");

View File

@ -1917,6 +1917,7 @@ ephoto_thumb_browser_recalc(Ephoto *ephoto)
ephoto_thumb_browser_clear(ephoto); ephoto_thumb_browser_clear(ephoto);
ephoto_directory_set(ephoto, ephoto->config->directory, ephoto_directory_set(ephoto, ephoto->config->directory,
NULL, 0, 1); NULL, 0, 1);
ephoto->thumb_browser_dirty = EINA_FALSE;
} }
void void