elm_toolbar_item_disabled_set(item, EINA_TRUE);
elm_toolbar_item_priority_set(item, 100);
- item = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1);
+ item = elm_toolbar_item_append(tb, PACKAGE_DATA_DIR"/images/icon_04.png", "World", tb_2, ph1);
elm_toolbar_item_priority_set(item, -100);
item = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3a, ph4);
static Eina_Bool _icon_standard_set(Widget_Data *wd, Evas_Object *obj, const char *name);
static Eina_Bool _icon_freedesktop_set(Widget_Data *wd, Evas_Object *obj, const char *name, int size);
+//FIXME: move this code to ecore
+#ifdef _WIN32
+static Eina_Bool
+_path_is_absolute(const char *path)
+{
+ //TODO: Check if this works with all absolute paths in windows
+ return ((isalpha (*path)) && (*(path + 1) == ':') && ((*(path + 2) == '\\') || (*(path + 2) == '/')));
+}
+#else
+static Eina_Bool
+_path_is_absolute(const char *path)
+{
+ return (*path == '/');
+}
+#endif
+
static void
_del_hook(Evas_Object *obj)
{
}
static Eina_Bool
+_icon_file_set(Widget_Data *wd, Evas_Object *obj, const char *path)
+{
+ if (elm_icon_file_set(obj, path, NULL))
+ {
+#ifdef ELM_EFREET
+ wd->freedesktop.use = EINA_FALSE;
+#endif
+ return EINA_TRUE;
+ }
+ return EINA_FALSE;
+}
+
+static Eina_Bool
_icon_freedesktop_set(Widget_Data *wd, Evas_Object *obj, const char *name, int size)
{
#ifdef ELM_EFREET
}
/**
- * Set the theme, as standard, for a icon
+ * Set the theme, as standard, for a icon.
+ * If theme was not found and it is the absolute path of an image file, this
+ * image will be used.
*
* @param obj The icon object
* @param name The theme name
return EINA_TRUE;
}
+ if (_path_is_absolute(name))
+ return _icon_file_set(wd, obj, name);
+
/* if that fails, see if icon name is in the format size/name. if so,
try locating a fallback without the size specification */
if (!(tmp = strchr(name, '/'))) return EINA_FALSE;