From d83486ff85d1cc64572a0ad0257e056370b95207 Mon Sep 17 00:00:00 2001 From: Jaehwan Kim Date: Mon, 12 Nov 2012 07:29:17 +0000 Subject: [PATCH] Add elm_toolbar_item_show/bring_in. It show or bring a specific item, when the toolbar can be scrolled. SVN revision: 79134 --- ChangeLog | 5 +++++ NEWS | 1 + src/lib/elm_toolbar.c | 32 ++++++++++++++++++++++++++++++++ src/lib/elm_toolbar.h | 24 ++++++++++++++++++++++++ 4 files changed, 62 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4546953..5aab029 100644 --- a/ChangeLog +++ b/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/NEWS b/NEWS index 01e7fd5..d7f7e92 100644 --- a/NEWS +++ b/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/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index 4d347ab..94db01e 100644 --- a/src/lib/elm_toolbar.c +++ b/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/src/lib/elm_toolbar.h b/src/lib/elm_toolbar.h index 775b857..33fe584 100644 --- a/src/lib/elm_toolbar.h +++ b/src/lib/elm_toolbar.h @@ -998,5 +998,29 @@ 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); + +/** * @} */ -- 2.7.4