discomfitor pushed a commit to branch master.

http://git.enlightenment.org/enlightenment/modules/desksanity.git/commit/?id=f572833e4392932950070c1b1ca63f08fdd55aa4

commit f572833e4392932950070c1b1ca63f08fdd55aa4
Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Sep 5 16:01:20 2014 -0400

    redo drag to be more indicative of results
---
 e-module-desksanity.edc | 123 +++++++++++++++++++++++++++++++++++++++++++-----
 src/zoom.c              |  31 +++++++-----
 2 files changed, 129 insertions(+), 25 deletions(-)

diff --git a/e-module-desksanity.edc b/e-module-desksanity.edc
index e74043b..28f71b7 100644
--- a/e-module-desksanity.edc
+++ b/e-module-desksanity.edc
@@ -46,11 +46,114 @@ collections {
    }
    group { name: "e/modules/desksanity/zoom/base"; program_source: "e";
       parts {
+         rect { "drag_clip"; nomouse;
+            desc { hid; }
+            desc { "vis";
+               link.base: "e,state,dragging";
+            }
+         }
+         rect { "zoomt"; clip: "drag_clip"; nomouse;
+            desc {
+               min: 0 4;
+               max: -1 4;
+               rel2.relative: 1 0;
+               color: 51 153 255 0;
+               hid;
+            }
+            desc { "enable"; inherit: "default";
+               color: 51 153 255 200;
+               vis;
+            }
+            desc { "anim"; inherit: "enable";
+               rel1.relative: 0.5 0.5;
+               rel2.relative: 0.5 0.5;
+            }
+         }
+         rect { "zooml"; clip: "drag_clip"; nomouse;
+            desc {
+               min: 4 0;
+               max: 4 -1;
+               rel2.relative: 0 1;
+               color: 51 153 255 0;
+               hid;
+            }
+            desc { "enable"; inherit: "default";
+               color: 51 153 255 200;
+               vis;
+            }
+            desc { "anim"; inherit: "enable";
+               rel1.relative: 0.5 0.5;
+               rel2.relative: 0.5 0.5;
+            }
+         }
+         rect { "zoomr"; clip: "drag_clip"; nomouse;
+            desc {
+               min: 4 0;
+               max: 4 -1;
+               rel1.relative: 1 0;
+               color: 51 153 255 0;
+               hid;
+            }
+            desc { "enable"; inherit: "default";
+               color: 51 153 255 200;
+               vis;
+            }
+            desc { "anim"; inherit: "enable";
+               rel1.relative: 0.5 0.5;
+               rel2.relative: 0.5 0.5;
+            }
+         }
+         rect { "zoomb"; clip: "drag_clip"; nomouse;
+            desc {
+               min: 0 4;
+               max: -1 4;;
+               rel1.relative: 0 1;
+               color: 51 153 255 0;
+               hid;
+            }
+            desc { "enable"; inherit: "default";
+               color: 51 153 255 200;
+               vis;
+            }
+            desc { "anim"; inherit: "enable";
+               rel1.relative: 0.5 0.5;
+               rel2.relative: 0.5 0.5;
+            }
+         }
+         program { signal: "e,state,current";
+            after: "drag_start";
+         }
+         program { "drag_start"; filter: "drag_clip" "vis";
+            signal: "mouse,in"; source: "events";
+            action: STATE_SET "enable";
+            transition: LINEAR 0.1;
+            targets: "zoomt" "zooml" "zoomr" "zoomb";
+            after: "drag_anim";
+         }
+         program { filter: "drag_clip" "vis";
+            signal: "mouse,out"; source: "events";
+            action: STATE_SET "default";
+            transition: ACCEL 0.1;
+            targets: "zoomt" "zooml" "zoomr" "zoomb";
+         }
+         program { "drag_anim";
+            action: STATE_SET "anim";
+            transition: ACCEL 0.8;
+            targets: "zoomt" "zooml" "zoomr" "zoomb";
+            after: "drag_anim2";
+         }
+         program { "drag_anim2";
+            action: STATE_SET "default";
+            targets: "zoomt" "zooml" "zoomr" "zoomb";
+            after: "drag_anim";
+         }
          swallow { "e.swallow.background"; clip: "clip";
          }
-         rect { "fader"; nomouse;
+         rect { "fader";
             desc {
                color: 0 0 0 0;
+               link.base: "e,state,dragging";
+               link.transition: LINEAR 0.3;
                link.base: "e,state,inactive";
                link.transition: LINEAR 0.3;
                link.after: "fade_post";
@@ -65,7 +168,9 @@ collections {
             }
          }
          rect { "clip";
-            desc { color: 255 255 255 0;
+            desc { hid; color: 255 255 255 0;
+               link.base: "e,state,dragging";
+               link.transition: LINEAR 0.3;
                link.base: "e,state,inactive";
                link.transition: LINEAR 0.3;
             }
@@ -78,6 +183,9 @@ collections {
          program { signal: "e,state,inactive";
             action: SIGNAL_EMIT "e,state,hiding" "e";
          }
+         rect { "events"; repeat;
+            desc { color: 0 0 0 0; }
+         }
       }
    }
    group { name: "e/modules/desksanity/zoom/scrollframe";
@@ -239,16 +347,6 @@ collections {
                link.base: "mouse,in" "events";
                link.transition: LINEAR 0.2;
             }
-            desc { "hid"; inherit: "default";
-               color: 255 255 255 0;
-               hid;
-               link.base: "e,drag,begin" "e";
-               link.transition: LINEAR 0.2;
-               link.after: "drag_begin";
-               program { "drag_begin";
-                  action: SIGNAL_EMIT "e,drag,begun" "e";
-               }
-            }
          }
          proxy { "clone";
             desc {
@@ -294,7 +392,6 @@ collections {
                after: "go_hid";
             }
             program { name: "go_hid";
-               signal: "e,drag,begin"; source: "e";
                action: STATE_SET "default" 0.0;
                transition: LINEAR 0.5;
                target: "clone";
diff --git a/src/zoom.c b/src/zoom.c
index e4f870e..a24585d 100644
--- a/src/zoom.c
+++ b/src/zoom.c
@@ -60,7 +60,6 @@ _hid(void *data EINA_UNUSED, Evas_Object *obj, const char 
*sig EINA_UNUSED, cons
    e_comp_shape_queue(e_comp_util_evas_object_comp_get(obj));
    evas_object_hide(obj);
    evas_object_del(obj);
-   _drag_reset();
 }
 
 static void
@@ -68,8 +67,15 @@ _zoom_hide(void)
 {
    Evas_Object *zoom_obj;
 
-   EINA_LIST_FREE(zoom_objs, zoom_obj)
-     edje_object_signal_emit(zoom_obj, "e,state,inactive", "e");
+   if (dm_drag)
+     EINA_LIST_FREE(zoom_objs, zoom_obj)
+       {
+          evas_object_hide(zoom_obj);
+          evas_object_del(zoom_obj);
+       }
+   else
+     EINA_LIST_FREE(zoom_objs, zoom_obj)
+       edje_object_signal_emit(zoom_obj, "e,state,inactive", "e");
    E_FREE_LIST(handlers, ecore_event_handler_del);
    e_comp_ungrab_input(e_comp_get(NULL), 1, 1);
    e_comp_shape_queue(e_comp_get(NULL));
@@ -82,6 +88,7 @@ static void
 _dismiss()
 {
    _zoom_hide();
+   _drag_reset();
 }
 
 static void
@@ -126,7 +133,8 @@ _client_mouse_move(void *d EINA_UNUSED, int t EINA_UNUSED, 
Ecore_Event_Mouse_Mov
    evas_object_geometry_get(dm, &x, &y, &w, &h);
    if (!dm_drag)
      {
-        Evas_Object *m;
+        Evas_Object *m, *zoom_obj;
+        Eina_List *l;
 
         /* no adjust, not X coords */
         if ((abs(ev->root.x - dx) < DRAG_RESIST) && (abs(ev->root.y - dy) < 
DRAG_RESIST)) return ECORE_CALLBACK_RENEW;
@@ -142,7 +150,13 @@ _client_mouse_move(void *d EINA_UNUSED, int t EINA_UNUSED, 
Ecore_Event_Mouse_Mov
         evas_object_size_hint_min_set(m, w, h);
         edje_object_part_swallow(dm_drag, "e.swallow.client", m);
         evas_object_show(dm_drag);
-        edje_object_signal_emit(evas_object_smart_parent_get(dm), 
"e,drag,begin", "e");
+
+        EINA_LIST_FOREACH(zoom_objs, l, zoom_obj)
+          {
+             edje_object_signal_emit(zoom_obj, "e,state,dragging", "e");
+             if (e_comp_object_util_zone_get(zoom_obj) == 
e_zone_current_get(e_comp_util_evas_object_comp_get(zoom_obj)))
+               edje_object_signal_emit(zoom_obj, "e,state,current", "e");
+          }
      }
    evas_object_move(dm_drag,
      e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - (dx - x),
@@ -191,12 +205,6 @@ _zoomobj_pack_client(const E_Client *ec, const E_Zone 
*zone, Evas_Object *tb, Ev
 }
 
 static void
-_client_drag_begun(void *data EINA_UNUSED, Evas_Object *obj, const char *sig 
EINA_UNUSED, const char *src EINA_UNUSED)
-{
-   evas_object_hide(obj);
-}
-
-static void
 _zoomobj_add_client(Evas_Object *zoom_obj, Eina_List *l, Evas_Object *m)
 {
    E_Client *ec;
@@ -214,7 +222,6 @@ _zoomobj_add_client(Evas_Object *zoom_obj, Eina_List *l, 
Evas_Object *m)
      edje_object_size_min_calc(e, &zmw, &zmh);
    edje_object_signal_callback_add(e, "e,action,activate", "e", 
_client_activate, ec);
    edje_object_signal_callback_add(e, "e,state,active", "e", _client_active, 
ec);
-   edje_object_signal_callback_add(e, "e,drag,begun", "e", _client_drag_begun, 
ec);
    if (e_client_focused_get() == ec)
      {
         edje_object_signal_emit(e, "e,state,focused", "e");

-- 


Reply via email to