Efl.Ui.Image: Add fallback when icon is not found in default theme
authorXavi Artigas <xavierartigas@yahoo.es>
Mon, 24 Feb 2020 14:02:30 +0000 (09:02 -0500)
committerJongmin Lee <jm105.lee@samsung.com>
Tue, 3 Mar 2020 21:14:37 +0000 (06:14 +0900)
Summary:
If _icon_standard_set() fails, _icon_freedesktop_set() is tried.

This was causing missing icons in the homescreen example, which uses
application icons which are obviously not present in the default theme.

Thanks to @bu5hm4n!

Test Plan: The homescreen sample application from the examples repository now correctly shows all missing icons.

Reviewers: bu5hm4n, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers, bu5hm4n

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11381

src/lib/elementary/efl_ui_image.c

index fe006eb..142ceda 100644 (file)
@@ -2167,6 +2167,11 @@ _internal_efl_ui_image_icon_set(Evas_Object *obj, const char *name, Eina_Bool *f
      {
         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
      {