From db9aec704df0351d97af5d76e03b18387758ac4b Mon Sep 17 00:00:00 2001 From: Jaehwan Kim Date: Mon, 3 Dec 2012 06:52:03 +0000 Subject: [PATCH] When the toolbar is deleted, there's no need to pass the selection to next item. SVN revision: 80008 --- legacy/elementary/src/lib/elm_toolbar.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/legacy/elementary/src/lib/elm_toolbar.c b/legacy/elementary/src/lib/elm_toolbar.c index 810dc423fb..13a34b87de 100644 --- a/legacy/elementary/src/lib/elm_toolbar.c +++ b/legacy/elementary/src/lib/elm_toolbar.c @@ -1669,12 +1669,16 @@ _item_del_pre_hook(Elm_Object_Item *it) if (item != sd->more_item) /* more item does not get in the list */ { - next = ELM_TOOLBAR_ITEM_FROM_INLIST(EINA_INLIST_GET(item)->next); + if (!sd->on_deletion) + next = ELM_TOOLBAR_ITEM_FROM_INLIST(EINA_INLIST_GET(item)->next); sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(item)); sd->item_count--; - if (!next) next = ELM_TOOLBAR_ITEM_FROM_INLIST(sd->items); - if ((sd->select_mode == ELM_OBJECT_SELECT_MODE_ALWAYS) && - item->selected && next) _item_select(next); + if (!sd->on_deletion) + { + if (!next) next = ELM_TOOLBAR_ITEM_FROM_INLIST(sd->items); + if ((sd->select_mode == ELM_OBJECT_SELECT_MODE_ALWAYS) && + item->selected && next) _item_select(next); + } } _item_del(item);