Icon
This feature is supported in wearable applications only.
The icon component inherits from the image component. It is used to display images in an icon context.
For more information, see the Icon API.
Figure: Icon hierarchy
Adding an Icon Component
To create an icon and set it as a freedesktop.org Home standard icon:
Evas_Object *icon, *parent; icon = elm_icon_add(parent); elm_icon_standard_set(icon, "Home");
Changing Image File
To change the image file:
-
Change the image by using an image in the filesystem (for example, /tmp/Home.png):
elm_image_file_set(icon, "/tmp/Home.png", NULL);
You can also use a group in an Edje file (for example, /tmp/Home.edj).
elm_image_file_set(icon, "/tmp/Home.edj", "elm/icon/Home/default");
-
A thumbnail can be generated and cached for future use. For this, you need the Ethumb library support.
elm_icon_thumb_set(icon, "/tmp/Home.png", NULL);
This function sets the file in the icon and enables the use of a cached thumbnail if it already exists. Otherwise, it creates a new thumbnail and caches it for future use.
Using Icon Callbacks
The icon component emits the following signals:
- thumb,done: The elm_icon_thumb_set() function is completed with success.
- thumb,error: The elm_icon_thumb_set() function fails.
In both cases, event_info is NULL.
Note |
---|
Except as noted, this content is licensed under LGPLv2.1+. |