raster pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=1631d09ffb04090034e45a131980d547368e0e00

commit 1631d09ffb04090034e45a131980d547368e0e00
Author: ami <[email protected]>
Date:   Sat Dec 28 17:48:11 2013 +0900

    [hoversel] - Added evas smart signal "expanded" in hoversel. This patch 
depends on D373.
    
    Test Plan: elementary_test -to Hoversel, Click on "Custom Item Style".
    
    Reviewers: seoz, raster, cedric
    
    Reviewed By: raster
    
    Differential Revision: https://phab.enlightenment.org/D381
---
 src/bin/test_hoversel.c | 34 ++++++++++++++++++++++++++++++++++
 src/lib/elc_hoversel.c  |  3 +++
 src/lib/elc_hoversel.h  |  1 +
 3 files changed, 38 insertions(+)

diff --git a/src/bin/test_hoversel.c b/src/bin/test_hoversel.c
index 473f050..98f5c46 100644
--- a/src/bin/test_hoversel.c
+++ b/src/bin/test_hoversel.c
@@ -115,10 +115,24 @@ _hoversel_dismissed_cb(void *data EINA_UNUSED, 
Evas_Object *obj EINA_UNUSED,
    printf("'dismissed' callback is called.\n");
 }
 
+static void
+_hoversel_expanded_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
+                       void *event_info EINA_UNUSED)
+{
+   Elm_Object_Item *it = data;
+
+   printf("'expanded' callback is called.\n");
+   printf("old style: %s\n", elm_object_item_style_get(it));
+   //item type is button. set the style of button
+   elm_object_item_style_set(it, "anchor");
+   printf("new style: %s\n", elm_object_item_style_get(it));
+}
+
 void
 test_hoversel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void 
*event_info EINA_UNUSED)
 {
    Evas_Object *win, *bx, *bt, *ic, *bxx, *hoversel;
+   Elm_Object_Item *it;
    char buf[PATH_MAX];
    api_data *api = calloc(1, sizeof(api_data));
 
@@ -236,6 +250,26 @@ test_hoversel(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *event_
    elm_box_pack_end(bx, hoversel);
    evas_object_show(hoversel);
 
+   hoversel = elm_hoversel_add(win);
+   elm_hoversel_hover_parent_set(hoversel, win);
+   elm_object_text_set(hoversel, "Custom Item Style");
+   elm_hoversel_item_add(hoversel, "Item 1", NULL, ELM_ICON_NONE, NULL, NULL);
+   elm_hoversel_item_add(hoversel, "Item 2", NULL, ELM_ICON_NONE, NULL, NULL);
+   elm_hoversel_item_add(hoversel, "Item 3", NULL, ELM_ICON_NONE, NULL, NULL);
+   elm_hoversel_item_add(hoversel, "Item 4", NULL, ELM_ICON_NONE, NULL, NULL);
+   it = elm_hoversel_item_add(hoversel, "Manage items", NULL, ELM_ICON_NONE, 
NULL, NULL);
+   evas_object_smart_callback_add(hoversel, "clicked",
+                                  _hoversel_clicked_cb, NULL);
+   evas_object_smart_callback_add(hoversel, "selected",
+                                  _hoversel_selected_cb, NULL);
+   evas_object_smart_callback_add(hoversel, "dismissed",
+                                  _hoversel_dismissed_cb, NULL);
+   //pass the last item as data and use elm_object_item_style_set() to change 
the item style.
+   evas_object_smart_callback_add(hoversel, "expanded",
+                                  _hoversel_expanded_cb, it);
+   elm_box_pack_end(bx, hoversel);
+   evas_object_show(hoversel);
+
    evas_object_resize(win, 320, 500);
 
    evas_object_show(win);
diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c
index 8c65fa5..f74aeb9 100644
--- a/src/lib/elc_hoversel.c
+++ b/src/lib/elc_hoversel.c
@@ -15,9 +15,11 @@ EAPI Eo_Op ELM_OBJ_HOVERSEL_BASE_ID = EO_NOOP;
 
 static const char SIG_SELECTED[] = "selected";
 static const char SIG_DISMISSED[] = "dismissed";
+static const char SIG_EXPANDED[] = "expanded";
 static const Evas_Smart_Cb_Description _smart_callbacks[] = {
    {SIG_SELECTED, ""},
    {SIG_DISMISSED, ""},
+   {SIG_EXPANDED, ""},
    {"clicked", ""}, /**< handled by parent button class */
    {NULL, NULL}
 };
@@ -177,6 +179,7 @@ _activate(Evas_Object *obj)
      elm_object_part_content_set(sd->hover, elm_hover_best_content_location_get
                                    (sd->hover, ELM_HOVER_AXIS_VERTICAL), bx);
 
+   evas_object_smart_callback_call(obj, SIG_EXPANDED, NULL);
    evas_object_show(sd->hover);
 }
 
diff --git a/src/lib/elc_hoversel.h b/src/lib/elc_hoversel.h
index 62e1c6d..cf9740e 100644
--- a/src/lib/elc_hoversel.h
+++ b/src/lib/elc_hoversel.h
@@ -25,6 +25,7 @@
  * - @c "selected" - an item in the hoversel list is selected. event_info
  *   is the selected item
  * - @c "dismissed" - the hover is dismissed
+ * - @c "expanded" - This is called on clicking hoversel and 
elm_hoversel_hover_begin().
  *
  * Default content parts of the hoversel widget that you can use for are:
  * @li "icon" - An icon of the hoversel

-- 


Reply via email to