rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=48cef367990638423076256c4fd02dd089f1615c

commit 48cef367990638423076256c4fd02dd089f1615c
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Wed Dec 2 12:08:24 2015 +0200

    groupedit: move and resize groupedit only if it necessary
    
    Change-Id: I6b01b4807c8fab5edb7a444a7f10fc01911a3424
---
 src/bin/ui/workspace/groupedit.c         | 45 +++++++++++++-------------------
 src/bin/ui/workspace/groupedit_calc.c    |  4 +--
 src/bin/ui/workspace/groupedit_private.h |  2 +-
 3 files changed, 21 insertions(+), 30 deletions(-)

diff --git a/src/bin/ui/workspace/groupedit.c b/src/bin/ui/workspace/groupedit.c
index 828935d..488b2bc 100644
--- a/src/bin/ui/workspace/groupedit.c
+++ b/src/bin/ui/workspace/groupedit.c
@@ -92,7 +92,7 @@ _groupedit_smart_add(Evas_Object *o)
                                   _unselect_part, o);
 
    priv->obj = o;
-   priv->con_current_size = (Groupedit_Geom *)mem_calloc(1, 
sizeof(Groupedit_Geom));
+   priv->geom = (Groupedit_Geom *)mem_calloc(1, sizeof(Groupedit_Geom));
    priv->zoom_factor = 1.0;
    priv->parts = NULL;
    priv->obj_area.obj = edje_object_add(priv->e);
@@ -123,7 +123,7 @@ _groupedit_smart_del(Evas_Object *o)
    evas_object_hide(sd->group->edit_object);
    evas_object_del(sd->edit_obj_clipper);
 
-   free(sd->con_current_size);
+   free(sd->geom);
    free(sd->obj_area.geom);
 
    _groupedit_parent_sc->del(o);
@@ -202,41 +202,32 @@ _groupedit_smart_calculate(Evas_Object *o)
    Evas_Coord px, py, pw, ph;
 
    WS_GROUPEDIT_DATA_GET(o, priv)
-   evas_object_geometry_get(priv->parent, &px, &py, &pw, &ph);
+      evas_object_geometry_get(priv->parent, &px, &py, &pw, &ph);
    evas_object_resize(priv->event, pw, ph);
    evas_object_move(priv->event, px, py);
 
    evas_object_geometry_get(o, &x, &y, &w, &h);
 
-   if (!priv->separated)
+   if ((priv->geom->x != x) || (priv->geom->y != y) ||
+       (priv->geom->w != w) || (priv->geom->h != h))
      {
-        priv->con_current_size->x = x;
-        priv->con_current_size->y = y;
-        priv->con_current_size->w = w;
-        priv->con_current_size->h = h;
+        priv->geom->x = x;
+        priv->geom->y = y;
+        priv->geom->w = w;
+        priv->geom->h = h;
+
+        evas_object_move(priv->group->edit_object,x ,y);
+        evas_object_resize(priv->group->edit_object, w, h);
+        evas_object_move(priv->box, x, y);
+        evas_object_resize(priv->box, w, h);
      }
-
-   DBG("Groupedit geometry: x[%i] y[%i] w[%i] h[%i]", x, y, w, h);
-   if (!priv->separated)
-     {
-        evas_object_move(priv->group->edit_object,
-                         priv->con_current_size->x,
-                         priv->con_current_size->y);
-     }
-   evas_object_resize(priv->group->edit_object,
-                      priv->con_current_size->w,
-                      priv->con_current_size->h);
-  evas_object_move(priv->box,
-                   priv->con_current_size->x,
-                   priv->con_current_size->y);
-
-   evas_object_resize(priv->box,
-                      priv->con_current_size->w,
-                      priv->con_current_size->h);
+   else
+     elm_box_recalculate(priv->box);
 
    priv->manual_calc = false;
 
-   evas_object_smart_callback_call(o, SIG_CHANGED, (void 
*)priv->con_current_size);
+   DBG("Groupedit geometry: x[%i] y[%i] w[%i] h[%i]", x, y, w, h);
+   evas_object_smart_callback_call(o, SIG_CHANGED, (void *)priv->geom);
 }
 
 /* this need for macro EVAS_SMART_SUBCLASS_NEW */
diff --git a/src/bin/ui/workspace/groupedit_calc.c 
b/src/bin/ui/workspace/groupedit_calc.c
index 9943ca8..14dbb9e 100644
--- a/src/bin/ui/workspace/groupedit_calc.c
+++ b/src/bin/ui/workspace/groupedit_calc.c
@@ -1235,7 +1235,7 @@ _part_object_area_calc(Ws_Groupedit_Smart_Data *sd, 
Groupedit_Part *gp)
    y = (yc + (int)(hc * relative)) + offset;
    edje_edit_string_free(rel_to);
 
-   xc = xg; wc = sd->con_current_size->w;
+   xc = xg; wc = sd->geom->w;
    rel_to = edje_edit_state_rel2_to_x_get(sd->group->edit_object, name, state, 
value);
    relative = edje_edit_state_rel2_relative_x_get(sd->group->edit_object, 
name, state, value);
    offset = edje_edit_state_rel2_offset_x_get(sd->group->edit_object, name, 
state, value);
@@ -1248,7 +1248,7 @@ _part_object_area_calc(Ws_Groupedit_Smart_Data *sd, 
Groupedit_Part *gp)
    if (w < 0) { x += w; w = 0; }
    edje_edit_string_free(rel_to);
 
-   yc = yg; hc = sd->con_current_size->h;
+   yc = yg; hc = sd->geom->h;
    rel_to = edje_edit_state_rel2_to_y_get(sd->group->edit_object, name, state, 
value);
    relative = edje_edit_state_rel2_relative_y_get(sd->group->edit_object, 
name, state, value);
    offset = edje_edit_state_rel2_offset_y_get(sd->group->edit_object, name, 
state, value);
diff --git a/src/bin/ui/workspace/groupedit_private.h 
b/src/bin/ui/workspace/groupedit_private.h
index e397c96..5595105 100644
--- a/src/bin/ui/workspace/groupedit_private.h
+++ b/src/bin/ui/workspace/groupedit_private.h
@@ -62,6 +62,7 @@ struct _Ws_Groupedit_Smart_Data
    Evas_Object *container;
    Evas_Object *parent;
    Evas_Object *box;
+   Groupedit_Geom *geom;
    /* Paddings which solve scroller issue,
       when container data move to 0,0 coords */
    struct {
@@ -79,7 +80,6 @@ struct _Ws_Groupedit_Smart_Data
       int w; /* default: -1, size is not limited */
       int h; /* default: -1, size is not limited */
    } con_size_max;
-   Groupedit_Geom *con_current_size;
    struct {
       Evas_Object *obj;
       int w, h;

-- 


Reply via email to