rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=904e430b6392e2d2fb68d74948d14dc2d322564f

commit 904e430b6392e2d2fb68d74948d14dc2d322564f
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Mon Dec 7 10:56:40 2015 +0200

    groupedit: show/hide part by signal from group_navigator
    
    Change-Id: Ib8b08f32fdcabd9627332624fb3d2e42a4351c90
---
 src/bin/ui/workspace/groupedit.c      | 14 +++++++-------
 src/bin/ui/workspace/groupedit.h      |  8 +++-----
 src/bin/ui/workspace/groupedit_calc.c |  2 ++
 src/bin/ui/workspace/workspace.c      | 22 ++++++++++++++++++++--
 4 files changed, 32 insertions(+), 14 deletions(-)

diff --git a/src/bin/ui/workspace/groupedit.c b/src/bin/ui/workspace/groupedit.c
index b5f58aa..e4c27ec 100644
--- a/src/bin/ui/workspace/groupedit.c
+++ b/src/bin/ui/workspace/groupedit.c
@@ -444,21 +444,21 @@ groupedit_edit_object_part_select(Evas_Object *obj, const 
char *part)
 
 TODO("remove this from public API and use callback from part list");
 
-Eina_Bool
-groupedit_part_visible_set(Evas_Object *obj, const char *part, Eina_Bool 
visible __UNUSED__)
+void
+groupedit_part_visible_set(Evas_Object *obj, Part_ *part)
 {
    Groupedit_Part *gp;
    WS_GROUPEDIT_DATA_GET(obj, sd);
 
    assert(part != NULL);
 
-   gp = _parts_list_find(sd->parts, part);
+   gp = _parts_list_find(sd->parts, part->name);
 
    assert(gp != NULL);
-
-   sd->manual_calc = true;
-   evas_object_smart_changed(sd->obj);
-   return true;
+   if (part->visible)
+     evas_object_show(gp->draw);
+   else
+     evas_object_hide(gp->draw);
 }
 
 Eina_Bool
diff --git a/src/bin/ui/workspace/groupedit.h b/src/bin/ui/workspace/groupedit.h
index e7844f0..4858c56 100644
--- a/src/bin/ui/workspace/groupedit.h
+++ b/src/bin/ui/workspace/groupedit.h
@@ -252,15 +252,13 @@ groupedit_edit_object_part_select(Evas_Object *obj, const 
char *part);
  * Set a visibility for groupedit part.
  *
  * @param obj The groupedit object
- * @param part The name of groupedit part to be showed of hided
+ * @param part The Part object to be showed of hided
  * @param visible Use EINA_TRUE to show, EINA_FALSE to hide part.
  *
- * @return EINA_FALSE on failure, EINA_TRUE on success.
- *
  * @ingroup Groupedit
  */
-Eina_Bool
-groupedit_part_visible_set(Evas_Object *obj, const char *part, Eina_Bool 
visible);
+void
+groupedit_part_visible_set(Evas_Object *obj, Part_ *part);
 
 /**
  * Restack part above another part in groupedit module.
diff --git a/src/bin/ui/workspace/groupedit_calc.c 
b/src/bin/ui/workspace/groupedit_calc.c
index e0b74ae..c65208e 100644
--- a/src/bin/ui/workspace/groupedit_calc.c
+++ b/src/bin/ui/workspace/groupedit_calc.c
@@ -706,6 +706,8 @@ _part_draw_add(Ws_Groupedit_Smart_Data *sd, Part_ *part)
    evas_object_show(gp->layout);
    elm_box_pack_end(gp->draw, gp->layout);
 
+   gp->part->visible = true;
+
 #define PART_VIEW_PROXY_SET() \
    gp->proxy_part = evas_object_image_filled_add(sd->e); \
    evas_object_size_hint_weight_set(gp->proxy_part, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND); \
diff --git a/src/bin/ui/workspace/workspace.c b/src/bin/ui/workspace/workspace.c
index 87e442b..b3cca6c 100644
--- a/src/bin/ui/workspace/workspace.c
+++ b/src/bin/ui/workspace/workspace.c
@@ -1461,6 +1461,20 @@ _on_group_navigator_part_state_select(void *data,
 }
 
 static void
+_on_group_navigator_part_visible_changed(void *data,
+                                Evas_Object *obj __UNUSED__,
+                                void *event_info)
+{
+   Evas_Object *workspace = (Evas_Object *)data;
+   Part_ *part = event_info;
+
+   WS_DATA_GET(workspace, sd);
+
+   groupedit_part_visible_set(sd->groupedit, part);
+}
+
+
+static void
 _on_groupedit_part_unselect(void *data,
                             Evas_Object *obj __UNUSED__,
                             void *event_info __UNUSED__)
@@ -1500,6 +1514,9 @@ workspace_add(Evas_Object *parent, Group *group)
                                   _on_group_navigator_part_select, obj);
    evas_object_smart_callback_add(sd->group_navigator, 
SIGNAL_GROUP_NAVIGATOR_PART_STATE_SELECTED,
                                   _on_group_navigator_part_state_select, obj);
+   evas_object_smart_callback_add(sd->group_navigator, 
SIGNAL_GROUP_NAVIGATOR_PART_VISIBLE_CHANGED,
+                                  _on_group_navigator_part_visible_changed, 
obj);
+
 
    /* create conteiner with handlers */
    sd->container.obj = container_add(sd->scroller);
@@ -1729,12 +1746,13 @@ workspace_edit_object_part_restack(Evas_Object *obj,
 Eina_Bool
 workspace_edit_object_visible_set(Evas_Object *obj,
                                   const char *part,
-                                  Eina_Bool visible)
+                                  Eina_Bool visible __UNUSED__)
 {
    WS_DATA_GET(obj, sd);
    assert(part != NULL);
 
-   return groupedit_part_visible_set(sd->groupedit, part, visible);
+   //groupedit_part_visible_set(sd->groupedit, part);
+   return true;
 }
 
 Eina_Bool

-- 


Reply via email to