return o;
}
+EAPI void
+e_util_icon_file_set(Evas_Object *icon, const char *path)
+{
+ const char *ext;
+
+ if (!path) return;
+ if (!ecore_file_exists(path)) return;
+
+ ext = strrchr(path, '.');
+ if (ext)
+ {
+ if (!strcmp(ext, ".edj"))
+ e_icon_file_edje_set(icon, path, "icon");
+ else
+ e_icon_file_set(icon, path);
+ }
+ else
+ e_icon_file_set(icon, path);
+}
+
EAPI Evas_Object *
e_util_desktop_icon_add(Efreet_Desktop *desktop, unsigned int size, Evas *evas)
{
return e_util_icon_theme_icon_add(desktop->icon, size, evas);
}
+EAPI void
+e_util_desktop_icon_file_set(Evas_Object *icon, Efreet_Desktop *desktop, unsigned int size)
+{
+ if ((!desktop) || (!desktop->icon)) return;
+ return e_util_icon_theme_icon_file_set(icon, desktop->icon, size);
+}
+
EAPI Evas_Object *
e_util_icon_theme_icon_add(const char *icon_name, unsigned int size, Evas *evas)
{
}
EAPI void
+e_util_icon_theme_icon_file_set(Evas_Object *icon, const char *icon_name, unsigned int size)
+{
+ if (!icon_name) return;
+ if (icon_name[0] == '/')
+ {
+ e_util_icon_file_set(icon, icon_name);
+ }
+ else
+ {
+ char *path;
+
+ path = efreet_icon_path_find(e_config->icon_theme, icon_name, size);
+ if (path)
+ {
+ e_util_icon_file_set(icon, path);
+ free(path);
+ }
+ }
+}
+
+EAPI void
e_util_desktop_menu_item_icon_add(Efreet_Desktop *desktop, unsigned int size, E_Menu_Item *mi)
{
char *path = NULL;
EAPI void e_util_library_path_strip(void);
EAPI void e_util_library_path_restore(void);
EAPI Evas_Object *e_util_icon_add(const char *path, Evas *evas);
+EAPI void e_util_icon_file_set(Evas_Object *icon, const char *path);
EAPI Evas_Object *e_util_desktop_icon_add(Efreet_Desktop *desktop, unsigned int size, Evas *evas);
+EAPI void e_util_desktop_icon_file_set(Evas_Object *icon, Efreet_Desktop *desktop, unsigned int size);
EAPI Evas_Object *e_util_icon_theme_icon_add(const char *icon_name, unsigned int size, Evas *evas);
+EAPI void e_util_icon_theme_icon_file_set(Evas_Object *icon, const char *icon_name, unsigned int size);
EAPI void e_util_desktop_menu_item_icon_add(Efreet_Desktop *desktop, unsigned int size, E_Menu_Item *mi);
EAPI int e_util_dir_check(const char *dir);
EAPI void e_util_defer_object_del(E_Object *obj);
e_box_freeze(b->o_box);
EINA_LIST_FOREACH(b->icons, l, ic)
{
+ if ((w > 0) && (h > 0))
+ {
+ int size;
+
+ size = MAX(w, h);
+ /* TODO: Check icon padding */
+ if (ic->o_icon) e_util_desktop_icon_file_set(ic->o_icon, ic->app, size);
+ if (ic->o_icon2) e_util_desktop_icon_file_set(ic->o_icon2, ic->app, size);
+ }
e_box_pack_options_set(ic->o_holder,
1, 1, /* fill */
0, 0, /* expand */
static void
_ibar_icon_fill(IBar_Icon *ic)
{
- /* TODO: Correct icon size! */
if (ic->o_icon) evas_object_del(ic->o_icon);
ic->o_icon = e_util_desktop_icon_add(ic->app, 48,
evas_object_evas_get(ic->ibar->o_box));