summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/bin/e_gadcon.c7
-rw-r--r--src/modules/gadman/e_mod_gadman.c51
4 files changed, 62 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b8a07e7..517d5a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
12013-07-26 Mike Blumenkrantz 12013-07-26 Mike Blumenkrantz
2 2
3 * fixed bug where setting min size on a gadget would not be passed to desktop gadgets
4
52013-07-26 Mike Blumenkrantz
6
3 * fixed bug where double clicking filemanager windows would not correctly autosize 7 * fixed bug where double clicking filemanager windows would not correctly autosize
4 8
52013-06-20 Mike Blumenkrantz 92013-06-20 Mike Blumenkrantz
diff --git a/NEWS b/NEWS
index 259e921..f3c50a2 100644
--- a/NEWS
+++ b/NEWS
@@ -227,3 +227,4 @@ Fixes:
227 * fixed bug with filemanager setting path with too many spaces when opened from menu 227 * fixed bug with filemanager setting path with too many spaces when opened from menu
228 * fixed crash when multiple windows shared a remember 228 * fixed crash when multiple windows shared a remember
229 * fixed bug where double clicking filemanager windows would not correctly autosize 229 * fixed bug where double clicking filemanager windows would not correctly autosize
230 * fixed bug where setting min size on a gadget would not be passed to desktop gadgets
diff --git a/src/bin/e_gadcon.c b/src/bin/e_gadcon.c
index ec32ab5..3f0c2ba 100644
--- a/src/bin/e_gadcon.c
+++ b/src/bin/e_gadcon.c
@@ -3678,7 +3678,12 @@ e_gadcon_layout_pack_min_size_set(Evas_Object *obj, int w, int h)
3678 3678
3679 if (!obj) return; 3679 if (!obj) return;
3680 bi = evas_object_data_get(obj, "e_gadcon_layout_data"); 3680 bi = evas_object_data_get(obj, "e_gadcon_layout_data");
3681 if (!bi) return; 3681 if (!bi)
3682 {
3683 evas_object_size_hint_min_set(obj, w, h);
3684 edje_extern_object_min_size_set(obj, w, h);
3685 return;
3686 }
3682 if (bi->sd->horizontal) 3687 if (bi->sd->horizontal)
3683 { 3688 {
3684 bi->min.w = w; 3689 bi->min.w = w;
diff --git a/src/modules/gadman/e_mod_gadman.c b/src/modules/gadman/e_mod_gadman.c
index ee77ca7..5b7996c 100644
--- a/src/modules/gadman/e_mod_gadman.c
+++ b/src/modules/gadman/e_mod_gadman.c
@@ -45,6 +45,9 @@ Manager *Man = NULL;
45static Eina_List *_gadman_hdls = NULL; 45static Eina_List *_gadman_hdls = NULL;
46static Eina_Hash *_gadman_gadgets = NULL; 46static Eina_Hash *_gadman_gadgets = NULL;
47 47
48/* for locking geometry during our own move/resize */
49static Eina_Bool mover_lock = EINA_FALSE;
50
48/* Implementation */ 51/* Implementation */
49void 52void
50gadman_reset(void) 53gadman_reset(void)
@@ -231,6 +234,19 @@ _gadman_gadget_free(void *data __UNUSED__, void *obj)
231 gadman_gadget_edit_end(NULL, NULL, NULL, NULL); 234 gadman_gadget_edit_end(NULL, NULL, NULL, NULL);
232} 235}
233 236
237static void
238_gadman_gadget_size_hints_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
239{
240 E_Gadcon_Client *gcc = data;
241 int w, h;
242
243 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
244 w = MAX(w, gcc->min.w);
245 h = MAX(h, gcc->min.h);
246 evas_object_resize(gcc->o_frame, w, h);
247 _save_widget_position(gcc);
248}
249
234static E_Gadcon_Client * 250static E_Gadcon_Client *
235gadman_gadget_place(E_Gadcon_Client *gcc, const E_Gadcon_Client_Class *cc, E_Config_Gadcon_Client *cf, Gadman_Layer_Type layer, E_Zone *zone) 251gadman_gadget_place(E_Gadcon_Client *gcc, const E_Gadcon_Client_Class *cc, E_Config_Gadcon_Client *cf, Gadman_Layer_Type layer, E_Zone *zone)
236{ 252{
@@ -290,6 +306,8 @@ gadman_gadget_place(E_Gadcon_Client *gcc, const E_Gadcon_Client_Class *cc, E_Con
290 edje_object_part_swallow(gcc->o_frame, "e.swallow.content", gcc->o_base); 306 edje_object_part_swallow(gcc->o_frame, "e.swallow.content", gcc->o_base);
291 evas_object_event_callback_add(gcc->o_frame, EVAS_CALLBACK_MOUSE_DOWN, 307 evas_object_event_callback_add(gcc->o_frame, EVAS_CALLBACK_MOUSE_DOWN,
292 on_frame_click, gcc); 308 on_frame_click, gcc);
309 evas_object_event_callback_add(gcc->o_frame, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
310 _gadman_gadget_size_hints_cb, gcc);
293 311
294 gcc->hidden = 1; 312 gcc->hidden = 1;
295 if (gcc->gadcon->id == ID_GADMAN_LAYER_TOP) 313 if (gcc->gadcon->id == ID_GADMAN_LAYER_TOP)
@@ -379,6 +397,24 @@ gadman_edit(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *e
379 _apply_widget_position(data); 397 _apply_widget_position(data);
380} 398}
381 399
400static void
401_gadman_gadget_edit_resize_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
402{
403 int w, h;
404 if (mover_lock) return;
405 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
406 evas_object_resize(_get_mover(data), w, h);
407}
408
409static void
410_gadman_gadget_edit_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
411{
412 int x, y;
413 if (mover_lock) return;
414 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
415 evas_object_move(_get_mover(data), x, y);
416}
417
382void 418void
383gadman_gadget_edit_start(E_Gadcon_Client *gcc) 419gadman_gadget_edit_start(E_Gadcon_Client *gcc)
384{ 420{
@@ -402,6 +438,8 @@ gadman_gadget_edit_start(E_Gadcon_Client *gcc)
402 mover = _get_mover(gcc); 438 mover = _get_mover(gcc);
403 if (!mover) return; 439 if (!mover) return;
404 evas_object_geometry_get(gcc->o_frame, &x, &y, &w, &h); 440 evas_object_geometry_get(gcc->o_frame, &x, &y, &w, &h);
441 evas_object_event_callback_add(gcc->o_frame, EVAS_CALLBACK_RESIZE, _gadman_gadget_edit_resize_cb, gcc);
442 evas_object_event_callback_add(gcc->o_frame, EVAS_CALLBACK_MOVE, _gadman_gadget_edit_move_cb, gcc);
405 Man->drag_gcc[gcc->gadcon->id - ID_GADMAN_LAYER_BASE] = gcc; 443 Man->drag_gcc[gcc->gadcon->id - ID_GADMAN_LAYER_BASE] = gcc;
406 444
407 evas_object_move(mover, x, y); 445 evas_object_move(mover, x, y);
@@ -434,6 +472,11 @@ gadman_gadget_edit_end(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const
434 EINA_LIST_FOREACH(Man->gadcons[layer], l, gc) 472 EINA_LIST_FOREACH(Man->gadcons[layer], l, gc)
435 gc->editing = 0; 473 gc->editing = 0;
436 drag_gcc = Man->drag_gcc[layer]; 474 drag_gcc = Man->drag_gcc[layer];
475 if (drag_gcc)
476 {
477 evas_object_event_callback_del_full(drag_gcc->o_frame, EVAS_CALLBACK_RESIZE, _gadman_gadget_edit_resize_cb, drag_gcc);
478 evas_object_event_callback_del_full(drag_gcc->o_frame, EVAS_CALLBACK_MOVE, _gadman_gadget_edit_move_cb, drag_gcc);
479 }
437 Man->drag_gcc[layer] = NULL; 480 Man->drag_gcc[layer] = NULL;
438 break; 481 break;
439 } 482 }
@@ -1242,6 +1285,7 @@ on_top(void *data, Evas_Object *o __UNUSED__, const char *em __UNUSED__, const c
1242 drag_gcc = Man->drag_gcc[layer]; 1285 drag_gcc = Man->drag_gcc[layer];
1243 1286
1244 mover = _get_mover(drag_gcc); 1287 mover = _get_mover(drag_gcc);
1288 mover_lock = EINA_TRUE;
1245 1289
1246 if (action == DRAG_START) 1290 if (action == DRAG_START)
1247 { 1291 {
@@ -1283,6 +1327,7 @@ on_top(void *data, Evas_Object *o __UNUSED__, const char *em __UNUSED__, const c
1283 evas_object_move(drag_gcc->o_frame, ox, my - drag_gcc->dy); 1327 evas_object_move(drag_gcc->o_frame, ox, my - drag_gcc->dy);
1284 _save_widget_position(drag_gcc); 1328 _save_widget_position(drag_gcc);
1285 } 1329 }
1330 mover_lock = EINA_FALSE;
1286} 1331}
1287 1332
1288static void 1333static void
@@ -1298,6 +1343,7 @@ on_right(void *data, Evas_Object *o __UNUSED__, const char *em __UNUSED__, const
1298 drag_gcc = Man->drag_gcc[layer]; 1343 drag_gcc = Man->drag_gcc[layer];
1299 1344
1300 mover = _get_mover(drag_gcc); 1345 mover = _get_mover(drag_gcc);
1346 mover_lock = EINA_TRUE;
1301 1347
1302 action = (int)(long)data; 1348 action = (int)(long)data;
1303 if (action == DRAG_START) 1349 if (action == DRAG_START)
@@ -1328,6 +1374,7 @@ on_right(void *data, Evas_Object *o __UNUSED__, const char *em __UNUSED__, const
1328 evas_object_resize(drag_gcc->o_frame, w, oh); 1374 evas_object_resize(drag_gcc->o_frame, w, oh);
1329 _save_widget_position(drag_gcc); 1375 _save_widget_position(drag_gcc);
1330 } 1376 }
1377 mover_lock = EINA_FALSE;
1331} 1378}
1332 1379
1333static void 1380static void
@@ -1343,6 +1390,7 @@ on_down(void *data, Evas_Object *o __UNUSED__, const char *em __UNUSED__, const
1343 drag_gcc = Man->drag_gcc[layer]; 1390 drag_gcc = Man->drag_gcc[layer];
1344 1391
1345 mover = _get_mover(drag_gcc); 1392 mover = _get_mover(drag_gcc);
1393 mover_lock = EINA_TRUE;
1346 1394
1347 if (action == DRAG_START) 1395 if (action == DRAG_START)
1348 { 1396 {
@@ -1372,6 +1420,7 @@ on_down(void *data, Evas_Object *o __UNUSED__, const char *em __UNUSED__, const
1372 evas_object_resize(drag_gcc->o_frame, ow, h); 1420 evas_object_resize(drag_gcc->o_frame, ow, h);
1373 _save_widget_position(drag_gcc); 1421 _save_widget_position(drag_gcc);
1374 } 1422 }
1423 mover_lock = EINA_FALSE;
1375} 1424}
1376 1425
1377static void 1426static void
@@ -1387,6 +1436,7 @@ on_left(void *data, Evas_Object *o __UNUSED__, const char *em __UNUSED__, const
1387 drag_gcc = Man->drag_gcc[layer]; 1436 drag_gcc = Man->drag_gcc[layer];
1388 1437
1389 mover = _get_mover(drag_gcc); 1438 mover = _get_mover(drag_gcc);
1439 mover_lock = EINA_TRUE;
1390 if (action == DRAG_START) 1440 if (action == DRAG_START)
1391 { 1441 {
1392 drag_gcc->resizing = 1; 1442 drag_gcc->resizing = 1;
@@ -1427,6 +1477,7 @@ on_left(void *data, Evas_Object *o __UNUSED__, const char *em __UNUSED__, const
1427 evas_object_move(drag_gcc->o_frame, mx - drag_gcc->dx, oy); 1477 evas_object_move(drag_gcc->o_frame, mx - drag_gcc->dx, oy);
1428 _save_widget_position(drag_gcc); 1478 _save_widget_position(drag_gcc);
1429 } 1479 }
1480 mover_lock = EINA_FALSE;
1430} 1481}
1431 1482
1432static void 1483static void