aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-01-18 15:02:11 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-01-18 15:02:11 -0500
commit265dd551636a9aa8db52149071aa8cc9ce1c2ba7 (patch)
tree797b5700813c1613b1d6195f8ee60fa19d47350e
parentflush injected gadget loader protocol connections after calling methods (diff)
downloadenlightenment-265dd551636a9aa8db52149071aa8cc9ce1c2ba7.tar.gz
sort gadgets alphabetically in gadget editor
-rw-r--r--src/bin/e_gadget.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/bin/e_gadget.c b/src/bin/e_gadget.c
index 5baf1c3f9..d4bb1168a 100644
--- a/src/bin/e_gadget.c
+++ b/src/bin/e_gadget.c
@@ -2820,6 +2820,15 @@ _editor_gadget_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED
elm_object_item_del(gi->it);
}
+static int
+_editor_sort(Elm_Object_Item *ita, Elm_Object_Item *itb)
+{
+ Gadget_Item *a = elm_object_item_data_get(ita);
+ Gadget_Item *b = elm_object_item_data_get(itb);
+
+ return strcasecmp(e_gadget_type_get(a->gadget), e_gadget_type_get(b->gadget));
+}
+
E_API Evas_Object *
e_gadget_editor_add(Evas_Object *parent, Evas_Object *site)
{
@@ -2907,9 +2916,9 @@ e_gadget_editor_add(Evas_Object *parent, Evas_Object *site)
evas_object_pass_events_set(g, 1);
evas_object_event_callback_add(g, EVAS_CALLBACK_DEL, _editor_gadget_del, gi);
if (orient)
- gi->it = elm_genlist_item_append(list, &gli, gi, NULL, 0, _editor_gadget_new, gi);
+ gi->it = elm_genlist_item_sorted_insert(list, &gli, gi, NULL, 0, (Eina_Compare_Cb)_editor_sort, _editor_gadget_new, gi);
else
- gi->it = elm_gengrid_item_append(list, &gli, gi, _editor_gadget_new, gi);
+ gi->it = elm_gengrid_item_sorted_insert(list, &gli, gi, (Eina_Compare_Cb)_editor_sort, _editor_gadget_new, gi);
}
evas_object_event_callback_add(list, EVAS_CALLBACK_DEL, _editor_del, parent);
e_comp_object_util_del_list_append(list, tempsite);