diff options
author | YeongJong Lee <cleanlyj@naver.com> | 2016-11-28 11:15:20 -0800 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2016-11-28 11:35:27 -0800 |
commit | 6584c6cc27913710e8e76b2278307c5696374576 (patch) | |
tree | afddf51380c779cf3e40874944ddfab1633727ff | |
parent | e037f30be40de25a492f7d10c7c6923a8218316a (diff) | |
download | efl-6584c6cc27913710e8e76b2278307c5696374576.tar.gz |
elm_toolbar: refactor _elm_toolbar_item_icon_obj_set function
Summary:
In order to natural animation in horizontal item theme,
remove duplicated operation in elm_toolbar_item_icon_obj_set function.
Test Plan:
Change to other icon using elm_toolbar_item_icon_obj_set function in horizontal item theme.
or in edi, click Logs/Console/Tests button on bottom toolbar
Reviewers: raster, ajwillia.ms
Reviewed By: ajwillia.ms
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4326
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r-- | src/lib/elementary/elm_toolbar.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/lib/elementary/elm_toolbar.c b/src/lib/elementary/elm_toolbar.c index 4f70b47eda..44dd5215e8 100644 --- a/src/lib/elementary/elm_toolbar.c +++ b/src/lib/elementary/elm_toolbar.c @@ -2576,6 +2576,7 @@ _elm_toolbar_item_icon_update(Elm_Toolbar_Item_Data *item) Eina_List *l; _elm_widget_sub_object_redirect_to_top(WIDGET(item), old_icon); + elm_layout_content_unset(VIEW(item), "elm.swallow.icon"); elm_layout_content_set(VIEW(item), "elm.swallow.icon", item->icon); if (item->icon) elm_layout_signal_emit(VIEW(item), "elm,state,icon,visible", "elm"); @@ -2597,8 +2598,6 @@ _elm_toolbar_item_icon_set_cb(void *data, const char *source) { Elm_Toolbar_Item_Data *item = data; - - elm_layout_content_unset(VIEW(item), "elm.swallow.icon"); _elm_toolbar_item_icon_update(item); elm_layout_signal_callback_del (obj, emission, source, _elm_toolbar_item_icon_set_cb); @@ -2624,19 +2623,6 @@ _elm_toolbar_item_icon_obj_set(Evas_Object *obj, eina_stringshare_del(item->icon_str); item->icon_str = NULL; } - if (item->icon) - { - Elm_Toolbar_Item_State *it_state; - Eina_List *l; - Eina_Bool found = EINA_FALSE; - EINA_LIST_FOREACH(item->states, l, it_state) - { - found |= (it_state->icon == item->icon); - } - if (!found) evas_object_del(item->icon); - else evas_object_hide(item->icon); - elm_layout_content_unset(VIEW(item), "elm.swallow.icon"); - } item->icon = icon_obj; if (icon_obj) |