summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <juyung.seo@samsung.com>2014-01-08 19:07:07 +0900
committerDaniel Juyung Seo <juyung.seo@samsung.com>2014-01-08 19:18:53 +0900
commit353975f1eb088d7d1cf578e43fab7d6d28cac2b7 (patch)
treee9bc930125bccaa687c4666010c9f27db6ed1b21
parentc277a0bb6f22a50752b5576bc518a93b510f037e (diff)
gengrid, genlist: Fallback into default item style if the required item
style does not exist.
-rw-r--r--src/lib/elm_gengrid.c11
-rw-r--r--src/lib/elm_genlist.c31
2 files changed, 33 insertions, 9 deletions
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index e872e943a..b7ec14a69 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -757,8 +757,15 @@ _item_realize(Elm_Gen_Item *it)
757 elm_widget_sub_object_add(WIDGET(it), VIEW(it)); 757 elm_widget_sub_object_add(WIDGET(it), VIEW(it));
758 snprintf(style, sizeof(style), "item/%s", 758 snprintf(style, sizeof(style), "item/%s",
759 it->itc->item_style ? it->itc->item_style : "default"); 759 it->itc->item_style ? it->itc->item_style : "default");
760 elm_widget_theme_object_set(WIDGET(it), VIEW(it), "gengrid", style, 760 if (!elm_widget_theme_object_set(WIDGET(it), VIEW(it), "gengrid", style,
761 elm_widget_style_get(WIDGET(it))); 761 elm_widget_style_get(WIDGET(it))))
762 {
763 ERR("%s is not a valid gengrid item style. "
764 "Automatically falls back into default style.",
765 it->itc->item_style);
766 elm_widget_theme_object_set
767 (WIDGET(it), VIEW(it), "gengrid", "item/default", "default");
768 }
762 evas_object_stack_below(VIEW(it), sd->stack); 769 evas_object_stack_below(VIEW(it), sd->stack);
763 770
764 if (edje_object_part_exists(VIEW(it), "elm.swallow.pad")) 771 if (edje_object_part_exists(VIEW(it), "elm.swallow.pad"))
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 3d7214bcb..741a77aea 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -1555,9 +1555,17 @@ _item_realize(Elm_Gen_Item *it,
1555 sd->mode == ELM_LIST_COMPRESS ? "_compress" : 1555 sd->mode == ELM_LIST_COMPRESS ? "_compress" :
1556 "", it->itc->item_style ? : "default"); 1556 "", it->itc->item_style ? : "default");
1557 1557
1558 elm_widget_theme_object_set 1558 if (!elm_widget_theme_object_set(WIDGET(it), VIEW(it),
1559 (WIDGET(it), VIEW(it), "genlist", buf, 1559 "genlist", buf,
1560 elm_widget_style_get(WIDGET(it))); 1560 elm_widget_style_get(WIDGET(it))))
1561 {
1562 ERR("%s is not a valid genlist item style. "
1563 "Automatically falls back into default style.",
1564 it->itc->item_style);
1565 elm_widget_theme_object_set
1566 (WIDGET(it), VIEW(it), "genlist", "item/default", "default");
1567 }
1568
1561 1569
1562 stacking_even = edje_object_data_get(VIEW(it), "stacking_even"); 1570 stacking_even = edje_object_data_get(VIEW(it), "stacking_even");
1563 if (!stacking_even) stacking_even = "above"; 1571 if (!stacking_even) stacking_even = "above";
@@ -4778,11 +4786,20 @@ _decorate_item_realize(Elm_Gen_Item *it)
4778 strncat(buf, "/", sizeof(buf) - strlen(buf) - 1); 4786 strncat(buf, "/", sizeof(buf) - strlen(buf) - 1);
4779 strncat(buf, it->itc->decorate_item_style, sizeof(buf) - strlen(buf) - 1); 4787 strncat(buf, it->itc->decorate_item_style, sizeof(buf) - strlen(buf) - 1);
4780 4788
4781 elm_widget_theme_object_set 4789 if (!elm_widget_theme_object_set
4782 (WIDGET(it), it->item->deco_it_view, "genlist", buf, 4790 (WIDGET(it), it->item->deco_it_view, "genlist", buf,
4783 elm_widget_style_get(WIDGET(it))); 4791 elm_widget_style_get(WIDGET(it))))
4792 {
4793
4794 ERR("%s is not a valid genlist item style. "
4795 "Automatically falls back into default style.",
4796 it->itc->decorate_item_style);
4797 elm_widget_theme_object_set
4798 (WIDGET(it), it->item->deco_it_view,
4799 "genlist", "item/default", "default");
4800 }
4784 edje_object_mirrored_set 4801 edje_object_mirrored_set
4785 (it->item->deco_it_view, elm_widget_mirrored_get(WIDGET(it))); 4802 (it->item->deco_it_view, elm_widget_mirrored_get(WIDGET(it)));
4786 4803
4787 /* signal callback add */ 4804 /* signal callback add */
4788 evas_object_event_callback_add 4805 evas_object_event_callback_add