From ad79256b8ea843d8683e7b0e78bd59f4573ccee1 Mon Sep 17 00:00:00 2001 From: Stephen Houston Date: Tue, 25 Nov 2014 14:15:27 -0600 Subject: [PATCH] Display a message when there are no imgaes in a directory that has been selected. --- src/bin/ephoto_thumb_browser.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/bin/ephoto_thumb_browser.c b/src/bin/ephoto_thumb_browser.c index 204cd98..0080f91 100644 --- a/src/bin/ephoto_thumb_browser.c +++ b/src/bin/ephoto_thumb_browser.c @@ -19,6 +19,7 @@ struct _Ephoto_Thumb_Browser Evas_Object *entry; Evas_Object *grid; Evas_Object *panel; + Evas_Object *nolabel; Eio_File *ls; Eina_List *todo_items; Eina_List *grid_items; @@ -344,6 +345,27 @@ _ephoto_thumb_populate_end(void *data, int type __UNUSED__, void *event __UNUSED free(tb); return ECORE_CALLBACK_PASS_ON; } + if (!tb->ephoto->entries) + { + elm_table_unpack(tb->table, tb->panel); + tb->nolabel = elm_label_add(tb->table); + elm_label_line_wrap_set(tb->nolabel, ELM_WRAP_WORD); + elm_object_text_set(tb->nolabel, "There are no images in this directory"); + evas_object_size_hint_weight_set(tb->nolabel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(tb->nolabel, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_table_pack(tb->table, tb->nolabel, 0, 0, 4, 1); + evas_object_show(tb->nolabel); + elm_table_pack(tb->table, tb->panel, 0, 0, 1, 1); + } + else + { + if (tb->nolabel) + { + elm_table_unpack(tb->table, tb->nolabel); + evas_object_del(tb->nolabel); + tb->nolabel = NULL; + } + } return ECORE_CALLBACK_PASS_ON; }