seoz pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=146344b9b3584348249ee4023cedee1bbd2dd4c4
commit 146344b9b3584348249ee4023cedee1bbd2dd4c4 Author: Daniel Juyung Seo <[email protected]> Date: Sun Jul 20 01:52:48 2014 +0900 test_toolbar: clean up clicked callback usage. - Removed unselected handling routine. As this is clicked callback, there will be no unselected status for the clicked item in clicked callback. - Removed check for event_info. In the clicked callback, event_info should be always valid. - Changed internal variable name for the more item. --- src/bin/test_toolbar.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/bin/test_toolbar.c b/src/bin/test_toolbar.c index eff8857..f535958 100644 --- a/src/bin/test_toolbar.c +++ b/src/bin/test_toolbar.c @@ -77,25 +77,20 @@ _tb_sel5_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUS static void toolbar_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info) { - Elm_Object_Item *it = elm_toolbar_more_item_get(obj); + Elm_Object_Item *more_it = elm_toolbar_more_item_get(obj); - if (event_info) - { - printf("toolbar item %p clicked", event_info); - if (elm_toolbar_item_selected_get(event_info)) - printf(" (selected)\n"); - else - printf(" (unselected)\n"); - } - if (!strcmp(elm_object_item_text_get(it), "Open") && (it == elm_toolbar_selected_item_get(obj))) + printf("toolbar item %p is clicked\n", event_info); + + if (!strcmp(elm_object_item_text_get(more_it), "Open") && + (more_it == elm_toolbar_selected_item_get(obj))) { - elm_toolbar_item_icon_set(it, "arrow_up"); - elm_object_item_text_set(it, "Close"); + elm_toolbar_item_icon_set(more_it, "arrow_up"); + elm_object_item_text_set(more_it, "Close"); } - else if (!strcmp(elm_object_item_text_get(it), "Close")) + else if (!strcmp(elm_object_item_text_get(more_it), "Close")) { - elm_toolbar_item_icon_set(it, "arrow_down"); - elm_object_item_text_set(it, "Open"); + elm_toolbar_item_icon_set(more_it, "arrow_down"); + elm_object_item_text_set(more_it, "Open"); } } --
