Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static Eina_Bool
- _internal_efl_ui_image_icon_set(Evas_Object *obj, const char *name, Eina_Bool *fdo)
- {
- char *tmp;
- Eina_Bool ret = EINA_FALSE;
- EFL_UI_IMAGE_DATA_GET(obj, sd);
- /* try locating the icon using the specified theme */
- if (!strcmp(ELM_CONFIG_ICON_THEME_ELEMENTARY, elm_config_icon_theme_get()))
- {
- ret = _icon_standard_set(obj, name);
- if (ret && fdo) *fdo = EINA_FALSE;
- if (!ret)
- {
- ret = _icon_freedesktop_set(obj, name, _icon_size_min_get(obj));
- if (ret && fdo) *fdo = EINA_TRUE;
- }
- }
- else
- {
- ret = _icon_freedesktop_set(obj, name, _icon_size_min_get(obj));
- if (ret && fdo) *fdo = EINA_TRUE;
- }
- if (ret)
- {
- eina_stringshare_replace(&sd->stdicon, name);
- efl_canvas_group_change(obj);
- return EINA_TRUE;
- }
- else
- eina_stringshare_replace(&sd->stdicon, NULL);
- if (_path_is_absolute(name))
- {
- if (fdo)
- *fdo = EINA_FALSE;
- return efl_file_simple_load(obj, name, NULL);
- }
- /* 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;
- ++tmp;
- if (*tmp) return _internal_efl_ui_image_icon_set(obj, tmp, fdo);
- /* give up */
- return EINA_FALSE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement