aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Houston <smhouston88@gmail.com>2017-10-02 14:03:52 -0500
committerStephen Houston <smhouston88@gmail.com>2017-10-02 14:03:52 -0500
commit93fd99ae03518570112e44aa3dc309a98b32595e (patch)
tree2ce00d83640452465c6d5257bb9b503c03d46396
parentEphoto: Don't refresh thumb browser unless the current state is viewing the t... (diff)
downloadephoto-93fd99ae03518570112e44aa3dc309a98b32595e.tar.gz
Set thumb browser dirty to change if it is not visible.
-rw-r--r--src/bin/ephoto.h1
-rw-r--r--src/bin/ephoto_config.c2
-rw-r--r--src/bin/ephoto_main.c5
-rw-r--r--src/bin/ephoto_thumb_browser.c1
4 files changed, 8 insertions, 1 deletions
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