summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2014-09-05 16:01:20 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2014-09-05 16:01:20 -0400
commitf572833e4392932950070c1b1ca63f08fdd55aa4 (patch)
tree29fb123b667dcfac1d6d194f4d781e07691641dc
parent61b7e4d18fd16f86c62ac64a3d706714f5c791e6 (diff)
redo drag to be more indicative of results
-rw-r--r--e-module-desksanity.edc123
-rw-r--r--src/zoom.c31
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 {
46 } 46 }
47 group { name: "e/modules/desksanity/zoom/base"; program_source: "e"; 47 group { name: "e/modules/desksanity/zoom/base"; program_source: "e";
48 parts { 48 parts {
49 rect { "drag_clip"; nomouse;
50 desc { hid; }
51 desc { "vis";
52 link.base: "e,state,dragging";
53 }
54 }
55 rect { "zoomt"; clip: "drag_clip"; nomouse;
56 desc {
57 min: 0 4;
58 max: -1 4;
59 rel2.relative: 1 0;
60 color: 51 153 255 0;
61 hid;
62 }
63 desc { "enable"; inherit: "default";
64 color: 51 153 255 200;
65 vis;
66 }
67 desc { "anim"; inherit: "enable";
68 rel1.relative: 0.5 0.5;
69 rel2.relative: 0.5 0.5;
70 }
71 }
72 rect { "zooml"; clip: "drag_clip"; nomouse;
73 desc {
74 min: 4 0;
75 max: 4 -1;
76 rel2.relative: 0 1;
77 color: 51 153 255 0;
78 hid;
79 }
80 desc { "enable"; inherit: "default";
81 color: 51 153 255 200;
82 vis;
83 }
84 desc { "anim"; inherit: "enable";
85 rel1.relative: 0.5 0.5;
86 rel2.relative: 0.5 0.5;
87 }
88 }
89 rect { "zoomr"; clip: "drag_clip"; nomouse;
90 desc {
91 min: 4 0;
92 max: 4 -1;
93 rel1.relative: 1 0;
94 color: 51 153 255 0;
95 hid;
96 }
97 desc { "enable"; inherit: "default";
98 color: 51 153 255 200;
99 vis;
100 }
101 desc { "anim"; inherit: "enable";
102 rel1.relative: 0.5 0.5;
103 rel2.relative: 0.5 0.5;
104 }
105 }
106 rect { "zoomb"; clip: "drag_clip"; nomouse;
107 desc {
108 min: 0 4;
109 max: -1 4;;
110 rel1.relative: 0 1;
111 color: 51 153 255 0;
112 hid;
113 }
114 desc { "enable"; inherit: "default";
115 color: 51 153 255 200;
116 vis;
117 }
118 desc { "anim"; inherit: "enable";
119 rel1.relative: 0.5 0.5;
120 rel2.relative: 0.5 0.5;
121 }
122 }
123 program { signal: "e,state,current";
124 after: "drag_start";
125 }
126 program { "drag_start"; filter: "drag_clip" "vis";
127 signal: "mouse,in"; source: "events";
128 action: STATE_SET "enable";
129 transition: LINEAR 0.1;
130 targets: "zoomt" "zooml" "zoomr" "zoomb";
131 after: "drag_anim";
132 }
133 program { filter: "drag_clip" "vis";
134 signal: "mouse,out"; source: "events";
135 action: STATE_SET "default";
136 transition: ACCEL 0.1;
137 targets: "zoomt" "zooml" "zoomr" "zoomb";
138 }
139 program { "drag_anim";
140 action: STATE_SET "anim";
141 transition: ACCEL 0.8;
142 targets: "zoomt" "zooml" "zoomr" "zoomb";
143 after: "drag_anim2";
144 }
145 program { "drag_anim2";
146 action: STATE_SET "default";
147 targets: "zoomt" "zooml" "zoomr" "zoomb";
148 after: "drag_anim";
149 }
49 swallow { "e.swallow.background"; clip: "clip"; 150 swallow { "e.swallow.background"; clip: "clip";
50 } 151 }
51 rect { "fader"; nomouse; 152 rect { "fader";
52 desc { 153 desc {
53 color: 0 0 0 0; 154 color: 0 0 0 0;
155 link.base: "e,state,dragging";
156 link.transition: LINEAR 0.3;
54 link.base: "e,state,inactive"; 157 link.base: "e,state,inactive";
55 link.transition: LINEAR 0.3; 158 link.transition: LINEAR 0.3;
56 link.after: "fade_post"; 159 link.after: "fade_post";
@@ -65,7 +168,9 @@ collections {
65 } 168 }
66 } 169 }
67 rect { "clip"; 170 rect { "clip";
68 desc { color: 255 255 255 0; 171 desc { hid; color: 255 255 255 0;
172 link.base: "e,state,dragging";
173 link.transition: LINEAR 0.3;
69 link.base: "e,state,inactive"; 174 link.base: "e,state,inactive";
70 link.transition: LINEAR 0.3; 175 link.transition: LINEAR 0.3;
71 } 176 }
@@ -78,6 +183,9 @@ collections {
78 program { signal: "e,state,inactive"; 183 program { signal: "e,state,inactive";
79 action: SIGNAL_EMIT "e,state,hiding" "e"; 184 action: SIGNAL_EMIT "e,state,hiding" "e";
80 } 185 }
186 rect { "events"; repeat;
187 desc { color: 0 0 0 0; }
188 }
81 } 189 }
82 } 190 }
83 group { name: "e/modules/desksanity/zoom/scrollframe"; 191 group { name: "e/modules/desksanity/zoom/scrollframe";
@@ -239,16 +347,6 @@ collections {
239 link.base: "mouse,in" "events"; 347 link.base: "mouse,in" "events";
240 link.transition: LINEAR 0.2; 348 link.transition: LINEAR 0.2;
241 } 349 }
242 desc { "hid"; inherit: "default";
243 color: 255 255 255 0;
244 hid;
245 link.base: "e,drag,begin" "e";
246 link.transition: LINEAR 0.2;
247 link.after: "drag_begin";
248 program { "drag_begin";
249 action: SIGNAL_EMIT "e,drag,begun" "e";
250 }
251 }
252 } 350 }
253 proxy { "clone"; 351 proxy { "clone";
254 desc { 352 desc {
@@ -294,7 +392,6 @@ collections {
294 after: "go_hid"; 392 after: "go_hid";
295 } 393 }
296 program { name: "go_hid"; 394 program { name: "go_hid";
297 signal: "e,drag,begin"; source: "e";
298 action: STATE_SET "default" 0.0; 395 action: STATE_SET "default" 0.0;
299 transition: LINEAR 0.5; 396 transition: LINEAR 0.5;
300 target: "clone"; 397 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
60 e_comp_shape_queue(e_comp_util_evas_object_comp_get(obj)); 60 e_comp_shape_queue(e_comp_util_evas_object_comp_get(obj));
61 evas_object_hide(obj); 61 evas_object_hide(obj);
62 evas_object_del(obj); 62 evas_object_del(obj);
63 _drag_reset();
64} 63}
65 64
66static void 65static void
@@ -68,8 +67,15 @@ _zoom_hide(void)
68{ 67{
69 Evas_Object *zoom_obj; 68 Evas_Object *zoom_obj;
70 69
71 EINA_LIST_FREE(zoom_objs, zoom_obj) 70 if (dm_drag)
72 edje_object_signal_emit(zoom_obj, "e,state,inactive", "e"); 71 EINA_LIST_FREE(zoom_objs, zoom_obj)
72 {
73 evas_object_hide(zoom_obj);
74 evas_object_del(zoom_obj);
75 }
76 else
77 EINA_LIST_FREE(zoom_objs, zoom_obj)
78 edje_object_signal_emit(zoom_obj, "e,state,inactive", "e");
73 E_FREE_LIST(handlers, ecore_event_handler_del); 79 E_FREE_LIST(handlers, ecore_event_handler_del);
74 e_comp_ungrab_input(e_comp_get(NULL), 1, 1); 80 e_comp_ungrab_input(e_comp_get(NULL), 1, 1);
75 e_comp_shape_queue(e_comp_get(NULL)); 81 e_comp_shape_queue(e_comp_get(NULL));
@@ -82,6 +88,7 @@ static void
82_dismiss() 88_dismiss()
83{ 89{
84 _zoom_hide(); 90 _zoom_hide();
91 _drag_reset();
85} 92}
86 93
87static void 94static void
@@ -126,7 +133,8 @@ _client_mouse_move(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Mov
126 evas_object_geometry_get(dm, &x, &y, &w, &h); 133 evas_object_geometry_get(dm, &x, &y, &w, &h);
127 if (!dm_drag) 134 if (!dm_drag)
128 { 135 {
129 Evas_Object *m; 136 Evas_Object *m, *zoom_obj;
137 Eina_List *l;
130 138
131 /* no adjust, not X coords */ 139 /* no adjust, not X coords */
132 if ((abs(ev->root.x - dx) < DRAG_RESIST) && (abs(ev->root.y - dy) < DRAG_RESIST)) return ECORE_CALLBACK_RENEW; 140 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
142 evas_object_size_hint_min_set(m, w, h); 150 evas_object_size_hint_min_set(m, w, h);
143 edje_object_part_swallow(dm_drag, "e.swallow.client", m); 151 edje_object_part_swallow(dm_drag, "e.swallow.client", m);
144 evas_object_show(dm_drag); 152 evas_object_show(dm_drag);
145 edje_object_signal_emit(evas_object_smart_parent_get(dm), "e,drag,begin", "e"); 153
154 EINA_LIST_FOREACH(zoom_objs, l, zoom_obj)
155 {
156 edje_object_signal_emit(zoom_obj, "e,state,dragging", "e");
157 if (e_comp_object_util_zone_get(zoom_obj) == e_zone_current_get(e_comp_util_evas_object_comp_get(zoom_obj)))
158 edje_object_signal_emit(zoom_obj, "e,state,current", "e");
159 }
146 } 160 }
147 evas_object_move(dm_drag, 161 evas_object_move(dm_drag,
148 e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - (dx - x), 162 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
191} 205}
192 206
193static void 207static void
194_client_drag_begun(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED)
195{
196 evas_object_hide(obj);
197}
198
199static void
200_zoomobj_add_client(Evas_Object *zoom_obj, Eina_List *l, Evas_Object *m) 208_zoomobj_add_client(Evas_Object *zoom_obj, Eina_List *l, Evas_Object *m)
201{ 209{
202 E_Client *ec; 210 E_Client *ec;
@@ -214,7 +222,6 @@ _zoomobj_add_client(Evas_Object *zoom_obj, Eina_List *l, Evas_Object *m)
214 edje_object_size_min_calc(e, &zmw, &zmh); 222 edje_object_size_min_calc(e, &zmw, &zmh);
215 edje_object_signal_callback_add(e, "e,action,activate", "e", _client_activate, ec); 223 edje_object_signal_callback_add(e, "e,action,activate", "e", _client_activate, ec);
216 edje_object_signal_callback_add(e, "e,state,active", "e", _client_active, ec); 224 edje_object_signal_callback_add(e, "e,state,active", "e", _client_active, ec);
217 edje_object_signal_callback_add(e, "e,drag,begun", "e", _client_drag_begun, ec);
218 if (e_client_focused_get() == ec) 225 if (e_client_focused_get() == ec)
219 { 226 {
220 edje_object_signal_emit(e, "e,state,focused", "e"); 227 edje_object_signal_emit(e, "e,state,focused", "e");