diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index 454695365b..5aab0298e0 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -669,3 +669,8 @@ * Support virtualkeypad, clipbard state shange signals from conformant + +2012-11-12 Jaehwan Kim + + * Add elm_toolbar_item_show/bring_in. + It show or bring a specific item, when the toolbar can be scrolled. diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index 01e7fd5688..d7f7e9241d 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -13,6 +13,7 @@ Additions: * Add a search API to list all localisations corresponding to a name in map * Add elm_notify_align_set/get * Add virtualkeypad, clipboard state change signals from conformant. + * Add elm_toolbar_item_show/bring_in. Improvements: diff --git a/legacy/elementary/src/lib/elm_toolbar.c b/legacy/elementary/src/lib/elm_toolbar.c index 4d347ab7ba..94db01e356 100644 --- a/legacy/elementary/src/lib/elm_toolbar.c +++ b/legacy/elementary/src/lib/elm_toolbar.c @@ -3256,3 +3256,35 @@ elm_toolbar_reorder_mode_get(const Evas_Object *obj) return sd->reorder_mode; } + +EAPI void +elm_toolbar_item_show(Elm_Object_Item *it) +{ + Evas_Coord x, y, w, h, bx, by; + Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it; + + ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it); + ELM_TOOLBAR_DATA_GET(WIDGET(item), sd); + + evas_object_geometry_get(sd->bx, &bx, &by, NULL, NULL); + evas_object_geometry_get(VIEW(item), &x, &y, &w, &h); + x = x - bx; + y = y - by; + sd->s_iface->content_region_show(WIDGET(item), x, y, w, h); +} + +EAPI void +elm_toolbar_item_bring_in(Elm_Object_Item *it) +{ + Evas_Coord x, y, w, h, bx, by; + Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it; + + ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it); + ELM_TOOLBAR_DATA_GET(WIDGET(item), sd); + + evas_object_geometry_get(sd->bx, &bx, &by, NULL, NULL); + evas_object_geometry_get(VIEW(item), &x, &y, &w, &h); + x = x - bx; + y = y - by; + sd->s_iface->region_bring_in(WIDGET(item), x, y, w, h); +} diff --git a/legacy/elementary/src/lib/elm_toolbar.h b/legacy/elementary/src/lib/elm_toolbar.h index 775b857ddf..33fe58495a 100644 --- a/legacy/elementary/src/lib/elm_toolbar.h +++ b/legacy/elementary/src/lib/elm_toolbar.h @@ -997,6 +997,30 @@ EAPI void elm_toolbar_reorder_mode_set(Evas_Object *obj */ EAPI Eina_Bool elm_toolbar_reorder_mode_get(const Evas_Object *obj); +/** + * Show a specific item, when the toolbar can be scrolled. + * + * @param it the toolbar item + * + * see elm_toolbar_item_bring_in() + * + * since 1.8 + * @ingroup Toolbar + */ +EAPI void elm_toolbar_item_show(Elm_Object_Item *it); + +/** + * Show a specific item with scroll animation, when the toolbar can be scrolled. + * + * @param it the toolbar item + * + * see elm_toolbar_item_show() + * + * since 1.8 + * @ingroup Toolbar + */ +EAPI void elm_toolbar_item_bring_in(Elm_Object_Item *it); + /** * @} */