Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1.  
  2. static Eina_Bool
  3. _internal_efl_ui_image_icon_set(Evas_Object *obj, const char *name, Eina_Bool *fdo)
  4. {
  5. char *tmp;
  6. Eina_Bool ret = EINA_FALSE;
  7.  
  8. EFL_UI_IMAGE_DATA_GET(obj, sd);
  9.  
  10. /* try locating the icon using the specified theme */
  11. if (!strcmp(ELM_CONFIG_ICON_THEME_ELEMENTARY, elm_config_icon_theme_get()))
  12. {
  13. ret = _icon_standard_set(obj, name);
  14. if (ret && fdo) *fdo = EINA_FALSE;
  15. if (!ret)
  16. {
  17. ret = _icon_freedesktop_set(obj, name, _icon_size_min_get(obj));
  18. if (ret && fdo) *fdo = EINA_TRUE;
  19. }
  20. }
  21. else
  22. {
  23. ret = _icon_freedesktop_set(obj, name, _icon_size_min_get(obj));
  24. if (ret && fdo) *fdo = EINA_TRUE;
  25. }
  26.  
  27. if (ret)
  28. {
  29. eina_stringshare_replace(&sd->stdicon, name);
  30. efl_canvas_group_change(obj);
  31. return EINA_TRUE;
  32. }
  33. else
  34. eina_stringshare_replace(&sd->stdicon, NULL);
  35.  
  36. if (_path_is_absolute(name))
  37. {
  38. if (fdo)
  39. *fdo = EINA_FALSE;
  40. return efl_file_simple_load(obj, name, NULL);
  41. }
  42.  
  43. /* if that fails, see if icon name is in the format size/name. if so,
  44. try locating a fallback without the size specification */
  45. if (!(tmp = strchr(name, '/'))) return EINA_FALSE;
  46. ++tmp;
  47. if (*tmp) return _internal_efl_ui_image_icon_set(obj, tmp, fdo);
  48. /* give up */
  49. return EINA_FALSE;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement