forked from enlightenment/enlightenment
e_widget needs to track sub objects so it knwos what to delete on deletion of
the widget. if u delete a sub object prematurely - u need to tell e_widget. u also need to dell it about the new object! SVN revision: 26616
This commit is contained in:
parent
f501859f3d
commit
69d34400a9
|
@ -134,6 +134,11 @@ EAPI void
|
|||
e_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj)
|
||||
{
|
||||
API_ENTRY return;
|
||||
if (evas_list_find(sd->subobjs, sobj))
|
||||
{
|
||||
printf("----------EEEEEK! dupe sub obj is a sub obj!\n");
|
||||
abort();
|
||||
}
|
||||
sd->subobjs = evas_list_append(sd->subobjs, sobj);
|
||||
if (!sd->child_can_focus)
|
||||
{
|
||||
|
|
|
@ -319,7 +319,7 @@ e_widget_fsel_add(Evas *evas, const char *dev, const char *path, char *selected,
|
|||
e_widget_table_object_append(wd->o_preview_preview_table,
|
||||
wd->o_preview_preview,
|
||||
0, 0, 1, 1, 0, 0, 1, 1);
|
||||
|
||||
|
||||
o = e_widget_label_add(evas, _("Size:"));
|
||||
wd->o_preview_size = o;
|
||||
e_widget_sub_object_add(obj, o);
|
||||
|
@ -576,9 +576,9 @@ _e_wid_fsel_preview_file(E_Widget_Data *wd)
|
|||
owner = _e_wid_file_user_get(st.st_uid);
|
||||
perms = _e_wid_file_perms_get(st.st_mode, st.st_uid, st.st_gid);
|
||||
mtime = _e_wid_file_time_get(st.st_mtime);
|
||||
|
||||
|
||||
e_widget_preview_thumb_set(wd->o_preview_preview, wd->path,
|
||||
"background", 128, 128);
|
||||
"e/desktop/background", 128, 128);
|
||||
|
||||
e_widget_table_object_repack(wd->o_preview_preview_table,
|
||||
wd->o_preview_preview,
|
||||
|
|
|
@ -59,8 +59,7 @@ e_widget_preview_file_set(Evas_Object *obj, const char *file, const char *key)
|
|||
|
||||
wd = e_widget_data_get(obj);
|
||||
|
||||
if (wd->o_thumb)
|
||||
evas_object_del(wd->o_thumb);
|
||||
if (wd->o_thumb) evas_object_del(wd->o_thumb);
|
||||
|
||||
wd->o_thumb = e_icon_add(e_livethumb_evas_get(wd->img));
|
||||
e_icon_file_key_set(wd->o_thumb, file, key);
|
||||
|
@ -73,28 +72,32 @@ EAPI int
|
|||
e_widget_preview_thumb_set(Evas_Object *obj, const char *file, const char *key, int w, int h)
|
||||
{
|
||||
E_Widget_Data *wd;
|
||||
|
||||
|
||||
wd = e_widget_data_get(obj);
|
||||
|
||||
|
||||
if (wd->img)
|
||||
evas_object_del(wd->img);
|
||||
|
||||
{
|
||||
e_widget_sub_object_del(obj, wd->img);
|
||||
evas_object_del(wd->img);
|
||||
}
|
||||
|
||||
wd->img = e_thumb_icon_add(evas_object_evas_get(obj));
|
||||
e_widget_sub_object_add(obj, wd->img);
|
||||
if (e_util_glob_case_match(file, "*.edj"))
|
||||
{
|
||||
/* FIXME: There is probably a quicker way of doing this. */
|
||||
if (edje_file_group_exists(file, "icon"))
|
||||
e_thumb_icon_file_set(wd->img, file, "icon");
|
||||
else if (edje_file_group_exists(file, "e/desktop/background"))
|
||||
e_thumb_icon_file_set(wd->img, file, "e/desktop/background");
|
||||
else if (edje_file_group_exists(file, "e/init/splash"))
|
||||
e_thumb_icon_file_set(wd->img, file, "e/init/splash");
|
||||
}
|
||||
{
|
||||
/* FIXME: There is probably a quicker way of doing this. */
|
||||
if (edje_file_group_exists(file, "icon"))
|
||||
e_thumb_icon_file_set(wd->img, file, "icon");
|
||||
else if (edje_file_group_exists(file, "e/desktop/background"))
|
||||
e_thumb_icon_file_set(wd->img, file, "e/desktop/background");
|
||||
else if (edje_file_group_exists(file, "e/init/splash"))
|
||||
e_thumb_icon_file_set(wd->img, file, "e/init/splash");
|
||||
}
|
||||
else
|
||||
e_thumb_icon_file_set(wd->img, file, NULL);
|
||||
evas_object_smart_callback_add(wd->img, "e_thumb_gen", _e_wid_preview_thumb_gen, wd);
|
||||
e_thumb_icon_size_set(wd->img, w, h);
|
||||
e_thumb_icon_begin(wd->img);
|
||||
evas_object_smart_callback_add(wd->img, "e_thumb_gen", _e_wid_preview_thumb_gen, wd);
|
||||
|
||||
edje_object_part_swallow(wd->o_frame, "e.swallow.content", wd->img);
|
||||
evas_object_show(wd->img);
|
||||
|
|
Loading…
Reference in New Issue