Icon Widgets

The icon widget inherits from the image widget. It is used to display images in an icon context.

Table of Contents

Adding a Icon

We can create an icon and set it as a “Home” standard icon.

Evas_Object *icon = elm_icon_add(parent);
elm_icon_standard_set(icon, "Home");

Default images provided by Elementary's default theme are described below.

standard (since 1.13)toolbarmenumedia player
“folder” “home” “menu/home” “media_player/forward“
“user-home” “close” “menu/close” “media_player/info“
“user-trash” “apps” “menu/apps” “media_player/next“
“view-close” “arrow_up” “menu/arrow_up” “media_player/pause“
“view-refresh” “arrow_down” “menu/arrow_down” “media_player/play“
“window-close” “arrow_left” “menu/arrow_left” “media_player/prev“
“document-close” “arrow_right““menu/arrow_right““media_player/rewind“
“document-edit” “chat” “menu/chat” “media_player/stop“
“dialog-info” “clock” “menu/clock”
“dialog-close” “delete” “menu/delete”
“arrow-up” “edit” “menu/edit”
“arrow-down” “refresh” “menu/refresh”
“arrow-left” “folder” “menu/folder”
“arrow-right” “file” “menu/file”

Changing Image File

We can change the image by using an image in the filesystem (for example, /tmp/Home.png),

elm_image_file_set(icon, "/tmp/Home.png", NULL);

or 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 widget emits the following signals:

  • “thumb,done” - elm_icon_thumb_set() is completed with success.
  • “thumb,error” - elm_icon_thumb_set() fails.

In both cases, event_info is NULL;

An Icon Example