edje: Set the default image in image set.
authorJaehwan Kim <jae.hwan.kim@samsung.com>
Tue, 18 Nov 2014 08:13:38 +0000 (17:13 +0900)
committerJaehwan Kim <jae.hwan.kim@samsung.com>
Tue, 18 Nov 2014 08:13:38 +0000 (17:13 +0900)
If there's no suitable image in image set, set the first image among
the set.

src/lib/edje/edje_calc.c

index 14627cd30287a389e4ed9e104baef0c0140b2475..f6d75e6cc7da45d19eaa18d2bdc7489183581983 100644 (file)
@@ -405,6 +405,23 @@ _edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps,
           }
      }
    
+  entry = eina_list_data_get(set->entries);
+  if (entry)
+    {
+       if (eps)
+         {
+            if (!*eps)
+              *eps = calloc(1, sizeof (Edje_Real_Part_Set));
+            if (*eps)
+              {
+                 (*eps)->entry = entry;
+                 (*eps)->set = set;
+                 (*eps)->id = id;
+              }
+         }
+       return entry->id;
+    }
+
    return -1;
 }