[elm] Revive file=NULL path on elm_photo_file_set().

Thanks, Tom, for pointing this out.



SVN revision: 71686
This commit is contained in:
Gustavo Lima Chaves 2012-06-04 16:23:31 +00:00
parent 842d711f3b
commit a348f6a8f2
4 changed files with 23 additions and 18 deletions

View File

@ -31,6 +31,8 @@ GROUP_ALIAS_ICON("edit", "toolbar/edit", "icon_edit.png", 32, 0);
GROUP_ALIAS_ICON("refresh", "toolbar/refresh", "icon_refresh.png", 32, 0);
GROUP_ALIAS_ICON("folder", "toolbar/folder", "icon_folder.png", 32, 0);
GROUP_ALIAS_ICON("file", "toolbar/file", "icon_file.png", 32, 0);
GROUP_ALIAS_ICON("no_photo", "photo/no_photo", "head.png", 32, 0);
///////////////////////////////////////////////////////////////////////////////
GROUP_ICON("menu/home", "icon_home.png", 24, 24);
GROUP_ICON("menu/close", "icon_close.png", 24, 24);

View File

@ -3,7 +3,6 @@ group { name: "elm/photo/base/default";
image: "frame_1.png" COMP;
image: "frame_2.png" COMP;
image: "dia_grad.png" COMP;
image: "head.png" COMP;
}
parts {
part { name: "base0";
@ -32,16 +31,6 @@ group { name: "elm/photo/base/default";
fill.smooth : 0;
}
}
part { name: "head";
mouse_events: 0;
description { state: "default" 0.0;
rel1.offset: 4 4;
rel2.offset: -5 -5;
aspect: 1.0 1.0;
aspect_preference: BOTH;
image.normal: "head.png";
}
}
part { name: "clip";
mouse_events: 0;
type: RECT;

View File

@ -361,6 +361,8 @@ elm_photo_add(Evas_Object *parent)
edje_object_part_swallow
(ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.content", sd->icon);
elm_photo_file_set(obj, NULL);
return obj;
}
@ -371,8 +373,16 @@ elm_photo_file_set(Evas_Object *obj,
ELM_PHOTO_CHECK(obj) EINA_FALSE;
ELM_PHOTO_DATA_GET(obj, sd);
if (!elm_image_file_set(sd->icon, file, NULL))
return EINA_FALSE;
if (!file)
{
if (!elm_icon_standard_set(sd->icon, "no_photo"))
return EINA_FALSE;
}
else
{
if (!elm_image_file_set(sd->icon, file, NULL))
return EINA_FALSE;
}
_sizing_eval(obj);

View File

@ -2,10 +2,11 @@
* @defgroup Photo Photo
* @ingroup Elementary
*
* An Elementary photo widget is intended for displaying a photo, for
* The Elementary photo widget is intended for displaying a photo, for
* ex., a person's image (contact). Simple, yet with a very specific
* purpose. It has a decorative frame around the inner image itself,
* on the default theme.
* on the default theme. If and while no photo is set on it, it
* displays a person icon, indicating it's a photo placeholder.
*
* This widget relies on an internal @ref Icon, so that the APIs of
* these two widgets are similar (drag and drop is also possible here,
@ -31,12 +32,15 @@
EAPI Evas_Object *elm_photo_add(Evas_Object *parent);
/**
* Set the file that will be used as photo
* Set the file that will be used as the photo widget's image.
*
* @param obj The photo object
* @param file The path to file that will be used as photo
* @param file The path to file that will be used as @a obj's image.
*
* @return (1 = success, 0 = error)
* @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
*
* @note Use @c NULL on @a file to set the photo widget back to it's
* initial state, which indicates "no photo".
*
* @ingroup Photo
*/