aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-02-04 09:09:15 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-02-04 09:09:15 +0000
commit93478999a36869526538c910cde9da4c54deeeee (patch)
tree2767191ef2ae13bd3623ed162838b52244dc2dad
parentoptimize use of edje_file_collection_list in various e things, also remove er... (diff)
downloadenlightenment-93478999a36869526538c910cde9da4c54deeeee.tar.gz
add support for edje files in filepreview widget
SVN revision: 83585
-rw-r--r--ChangeLog1
-rw-r--r--NEWS1
-rw-r--r--src/bin/e_widget_filepreview.c49
3 files changed, 48 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 043836abc..b86c9f3f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
2013-02-04 Mike Blumenkrantz
* optimize use of edje_file_collection_list
+ * add support for edje files in filepreview widget
2013-02-01 Mike Blumenkrantz
diff --git a/NEWS b/NEWS
index ab15673a8..8d77916d5 100644
--- a/NEWS
+++ b/NEWS
@@ -82,6 +82,7 @@ Improvements:
* binding dialogs are now able to reset bindings to the system profile file bindings
* "No listable items" in Navigate menu is now clickable
* optimize use of edje_file_collection_list
+ * add support for edje files in filepreview widget
Fixes:
* IBar menu didn't allow to configure different icon sources, show contents menu even on empty IBar.
diff --git a/src/bin/e_widget_filepreview.c b/src/bin/e_widget_filepreview.c
index 41d8e32e5..8d5a179b1 100644
--- a/src/bin/e_widget_filepreview.c
+++ b/src/bin/e_widget_filepreview.c
@@ -132,13 +132,58 @@ _e_wid_fprev_img_update(E_Widget_Data *wd, const char *path, const char *key)
{
if (!path) return;
if (wd->is_dir || wd->is_txt) return;
+ evas_object_smart_callback_del_full(wd->o_preview_preview, "preview_update", _e_wid_fprev_preview_update, wd);
if (eina_str_has_extension(path, ".gif"))
{
e_widget_preview_file_set(wd->o_preview_preview, path, key);
_e_wid_fprev_preview_update(wd, wd->o_preview_preview, NULL);
}
+ else if (eina_str_has_extension(path, ".edj"))
+ {
+ if (key)
+ e_widget_preview_edje_set(wd->o_preview_preview, path, key);
+ else
+ {
+ Eina_List *l;
+ Eina_Stringshare *str;
+ Eina_Bool set = EINA_FALSE;
+
+ l = edje_file_collection_list(path);
+ if (eina_list_count(l) < 2)
+ {
+ e_widget_preview_thumb_set(wd->o_preview_preview, path, eina_list_data_get(l), wd->w, wd->h);
+ set = EINA_TRUE;
+ edje_file_collection_list_free(l), l = NULL;
+ }
+ EINA_LIST_FREE(l, str)
+ {
+ Eina_Bool use = EINA_FALSE;
+
+ if (!strcmp(str, "icon")) use = EINA_TRUE;
+ else if (!strcmp(str, "e/desktop/background")) use = EINA_TRUE;
+ else if (!strcmp(str, "e/init/splash")) use = EINA_TRUE;
+
+ if (use)
+ {
+ e_widget_preview_thumb_set(wd->o_preview_preview, path, str, wd->w, wd->h);
+ set = EINA_TRUE;
+ break;
+ }
+ eina_stringshare_del(str);
+ }
+ if (!set)
+ {
+ e_widget_preview_edje_set(wd->o_preview_preview, path, NULL);
+ _e_wid_fprev_preview_update(wd, wd->o_preview_preview, NULL);
+ }
+ if (l) edje_file_collection_list_free(l);
+ }
+ }
else
- e_widget_preview_thumb_set(wd->o_preview_preview, path, key, wd->w, wd->h);
+ {
+ e_widget_preview_thumb_set(wd->o_preview_preview, path, key, wd->w, wd->h);
+ evas_object_smart_callback_add(wd->o_preview_preview, "preview_update", _e_wid_fprev_preview_update, wd);
+ }
}
static void
@@ -753,8 +798,6 @@ _e_wid_fprev_preview_reset(E_Widget_Data *wd)
o = e_widget_preview_add(evas_object_evas_get(wd->obj), wd->w, wd->h);
wd->prev_is_txt = wd->prev_is_fm = EINA_FALSE;
wd->o_preview_preview = o;
- evas_object_smart_callback_add(o, "preview_update",
- _e_wid_fprev_preview_update, wd);
e_widget_table_object_append(wd->o_preview_preview_table,
wd->o_preview_preview,
0, 0, 2, 1, 0, 0, 1, 1);