add new function to disable icon preloading

SVN revision: 64850
This commit is contained in:
Mike Blumenkrantz 2011-11-07 04:25:16 +00:00
parent 17fccb4b95
commit f379a27341
4 changed files with 30 additions and 1 deletions

View File

@ -5087,6 +5087,14 @@ extern "C" {
* @ingroup Icon
*/
EAPI Elm_Icon_Lookup_Order elm_icon_order_lookup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
* Enable or disable preloading of the icon
*
* @param obj The icon object
* @param disable If EINA_TRUE, preloading will be disabled
* @ingroup Icon
*/
EAPI void elm_icon_preload_set(Evas_Object *obj, Eina_Bool disable) EINA_ARG_NONNULL(1);
/**
* Get if the icon supports animation or not.
*

View File

@ -1024,3 +1024,13 @@ elm_icon_object_get(Evas_Object *obj)
if (!wd) return NULL;
return _els_smart_icon_object_get(wd->img);
}
EAPI void
elm_icon_preload_set(Evas_Object *obj, Eina_Bool disable)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
_els_smart_icon_preload_set(wd->img, disable);
}

View File

@ -141,6 +141,17 @@ _els_smart_icon_file_key_set(Evas_Object *obj, const char *file, const char *key
return EINA_TRUE;
}
void
_els_smart_icon_preload_set(Evas_Object *obj, Eina_Bool disable)
{
Smart_Data *sd;
sd = evas_object_smart_data_get(obj);
if ((!sd) || sd->edje) return;
evas_object_image_preload(sd->obj, disable);
sd->preloading = !disable;
}
Eina_Bool
_els_smart_icon_file_edje_set(Evas_Object *obj, const char *file, const char *part)
{

View File

@ -24,4 +24,4 @@ Eina_Bool _els_smart_icon_edit_get (const Evas_Object *obj);
Evas_Object *_els_smart_icon_edje_get(Evas_Object *obj);
void _els_smart_icon_aspect_ratio_retained_set(Evas_Object *obj, Eina_Bool retained);
Eina_Bool _els_smart_icon_aspect_ratio_retained_get(const Evas_Object *obj);
void _els_smart_icon_preload_set(Evas_Object *obj, Eina_Bool disable);