return e_theme_edje_object_set(o, buf, group);
}
-EAPI const char *
-e_theme_edje_file_get(const char *category, const char *group)
+const char *
+_e_theme_edje_file_get(const char *category, const char *group, Eina_Bool fallback_icon)
{
E_Theme_Result *res;
char buf[4096];
/* find category -> edje mapping */
_e_theme_category_register(category);
res = eina_hash_find(mappings, category);
+
+ if (e_config->icon_theme &&
+ (!fallback_icon) &&
+ (!strcmp(category, "base")) &&
+ (!strncmp(group, "e/icons", 7)))
+ return "";
+
if (res)
{
const char *str;
const char *col;
res->quickfind = eina_hash_string_superfast_new(NULL);
- /* great a quick find hash of all group entires */
+ /* create a quick find hash of all group entries */
coll = edje_file_collection_list(str);
+
EINA_LIST_FOREACH(coll, l, col)
{
q = eina_stringshare_add(col);
return e_theme_edje_file_get(buf, group);
}
+EAPI const char *
+e_theme_edje_file_get(const char *category, const char *group)
+{
+ return _e_theme_edje_file_get(category, group, EINA_FALSE);
+}
+
+EAPI const char *
+e_theme_edje_icon_fallback_file_get(const char *group)
+{
+ return _e_theme_edje_file_get("base", group, EINA_TRUE);
+}
+
/*
* this is used to set the theme for a CATEGORY of E17. "base" is always set
* to the default theme - because if a selected theme wants "base/theme", but
}
static int
-_e_util_icon_theme_set(Evas_Object *obj, const char *icon)
+_e_util_icon_theme_set(Evas_Object *obj, const char *icon, Eina_Bool fallback)
{
const char *file;
char buf[PATH_MAX];
if ((!icon) || (!icon[0])) return 0;
snprintf(buf, sizeof(buf), "e/icons/%s", icon);
- file = e_theme_edje_file_get("base/theme/icons", buf);
+
+ if (fallback)
+ file = e_theme_edje_icon_fallback_file_get(buf);
+ else
+ file = e_theme_edje_file_get("base/theme/icons", buf);
+
if (file[0])
{
e_icon_file_edje_set(obj, file, buf);
return 1;
}
+
return 0;
}
{
if (_e_util_icon_fdo_set(obj, icon))
return 1;
- return _e_util_icon_theme_set(obj, icon);
+ if (_e_util_icon_theme_set(obj, icon, EINA_FALSE))
+ return 1;
+ return _e_util_icon_theme_set(obj, icon, EINA_TRUE);
}
else
{
- if (_e_util_icon_theme_set(obj, icon))
+ if (_e_util_icon_theme_set(obj, icon, EINA_FALSE))
+ return 1;
+ if (_e_util_icon_fdo_set(obj, icon))
return 1;
- return _e_util_icon_fdo_set(obj, icon);
+ return _e_util_icon_theme_set(obj, icon, EINA_TRUE);
}
}
-/* WARNING This function is deprecated, You should
- * use e_util_menu_item_theme_icon_set() instead.
- * It provide fallback (e theme <-> fdo theme) in both direction */
-EAPI int
-e_util_menu_item_edje_icon_set(E_Menu_Item *mi, const char *name)
+int
+_e_util_menu_item_edje_icon_set(E_Menu_Item *mi, const char *name, Eina_Bool fallback)
{
const char *file;
char buf[PATH_MAX];
if ((!name) || (!name[0])) return 0;
- if (name[0]=='/' && ecore_file_exists(name))
+
+ if ((!fallback) && (name[0]=='/') && ecore_file_exists(name))
{
e_menu_item_icon_edje_set(mi, name, "icon");
return 1;
}
snprintf(buf, sizeof(buf), "e/icons/%s", name);
- file = e_theme_edje_file_get("base/theme/icons", buf);
+
+ if (fallback)
+ file = e_theme_edje_icon_fallback_file_get(buf);
+ else
+ file = e_theme_edje_file_get("base/theme/icons", buf);
+
if (file[0])
{
e_menu_item_icon_edje_set(mi, file, buf);
{
if (_e_util_menu_item_fdo_icon_set(mi, icon))
return 1;
- return e_util_menu_item_edje_icon_set(mi, icon);
+ if (_e_util_menu_item_edje_icon_set(mi, icon, EINA_FALSE))
+ return 1;
+ return _e_util_menu_item_edje_icon_set(mi, icon, EINA_TRUE);
}
else
{
- if (e_util_menu_item_edje_icon_set(mi, icon))
+ if (_e_util_menu_item_edje_icon_set(mi, icon, EINA_FALSE))
+ return 1;
+ if (_e_util_menu_item_fdo_icon_set(mi, icon))
return 1;
- return _e_util_menu_item_fdo_icon_set(mi, icon);
+ return _e_util_menu_item_edje_icon_set(mi, icon, EINA_TRUE);
}
}