summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2014-12-29 16:35:00 +0200
committerYakov Goldberg <yakov.g@samsung.com>2014-12-30 11:23:34 +0200
commit12a46d58425b2daa6565ff11b0da746db137c36a (patch)
treee98a3e7d6bd324670dffa5eec20015c38d34577b /src/bin
parentf59057eb9d947c966c063895d54bb02944faf868 (diff)
Add ecore timer to reload widget after drag and drop
- fix dragging from table
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/egui_gui/editor.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/bin/egui_gui/editor.c b/src/bin/egui_gui/editor.c
index 9e6176d..343c1f3 100644
--- a/src/bin/egui_gui/editor.c
+++ b/src/bin/egui_gui/editor.c
@@ -1597,13 +1597,17 @@ _drop_target_leave(void *data, Evas_Object *obj EINA_UNUSED)
1597 EINA_LIST_FOREACH(lst, l, it) 1597 EINA_LIST_FOREACH(lst, l, it)
1598 { 1598 {
1599 Gui_Widget_Property *prop = obj_container_item_prop_get(it); 1599 Gui_Widget_Property *prop = obj_container_item_prop_get(it);
1600 Eid *eid = EID_ID_GET(prop_value_nth_get(prop, 0));
1601 /* Don't pack widget which is currently dragged. */
1602 if (dnd_drag_wdg_get() == wdg_get(eid))
1603 {
1604 continue;
1605 }
1600 int ix, iy, iw, ih; 1606 int ix, iy, iw, ih;
1601 Eid *eid;
1602 ix = INT_GET(prop_value_nth_get(prop, 1)); 1607 ix = INT_GET(prop_value_nth_get(prop, 1));
1603 iy = INT_GET(prop_value_nth_get(prop, 2)); 1608 iy = INT_GET(prop_value_nth_get(prop, 2));
1604 iw = INT_GET(prop_value_nth_get(prop, 3)); 1609 iw = INT_GET(prop_value_nth_get(prop, 3));
1605 ih = INT_GET(prop_value_nth_get(prop, 4)); 1610 ih = INT_GET(prop_value_nth_get(prop, 4));
1606 eid = EID_ID_GET(prop_value_nth_get(prop, 0));
1607 Eo *c = session_eo_get(session, wdg_get(eid)); 1611 Eo *c = session_eo_get(session, wdg_get(eid));
1608 eo_do(wdg_eo, elm_obj_table_pack(c, ix, iy, iw, ih)); 1612 eo_do(wdg_eo, elm_obj_table_pack(c, ix, iy, iw, ih));
1609 } 1613 }
@@ -1616,6 +1620,16 @@ static Gui_Widget*
1616_editor_factory_wdg_create(const char *class_name, const Gui_Widget *focused_wdg, Evas_Coord main_wdg_x, Evas_Coord main_wdg_y); 1620_editor_factory_wdg_create(const char *class_name, const Gui_Widget *focused_wdg, Evas_Coord main_wdg_x, Evas_Coord main_wdg_y);
1617 1621
1618static Eina_Bool 1622static Eina_Bool
1623_wdg_reload_cb(void *data)
1624{
1625 Gui_Widget *wdg = data;
1626 _wdg_parent_win_reload(wdg);
1627 _editor_wdg_selected_set(wdg);
1628 objtree_item_selected_set(wdg);
1629 return ECORE_CALLBACK_CANCEL;
1630}
1631
1632static Eina_Bool
1619_drop_target_drop(void *data, Evas_Object *obj, Elm_Selection_Data *ev) 1633_drop_target_drop(void *data, Evas_Object *obj, Elm_Selection_Data *ev)
1620{ 1634{
1621 Gui_Widget *wdg = data; 1635 Gui_Widget *wdg = data;
@@ -1997,9 +2011,7 @@ end:
1997 di->eo_cur = NULL; 2011 di->eo_cur = NULL;
1998 } 2012 }
1999 2013
2000 _wdg_parent_win_reload(new_wdg); 2014 ecore_timer_add(0.2, _wdg_reload_cb, new_wdg);
2001 _editor_wdg_selected_set(new_wdg);
2002 objtree_item_selected_set(new_wdg);
2003 2015
2004 return EINA_TRUE; 2016 return EINA_TRUE;
2005} 2017}
@@ -2315,6 +2327,8 @@ _drag_start_cb(const Gui_Widget *wdg, const Eo *_wdg_eo)
2315 else if (!strcmp(wdg_class_name_get(wdg_container), DB_DEF_TABLE_CLASS)) 2327 else if (!strcmp(wdg_class_name_get(wdg_container), DB_DEF_TABLE_CLASS))
2316 { 2328 {
2317 eo_do(wdg_cont_eo, elm_obj_table_unpack(wdg_eo)); 2329 eo_do(wdg_cont_eo, elm_obj_table_unpack(wdg_eo));
2330 /* Object will be deleted automatically by evas*/
2331 session_wdg_existence_set((Gui_Session *) session, wdg, EINA_FALSE);
2318 } 2332 }
2319 /* Explicitly call target enter/pos cb, in order to calculate packing coords. */ 2333 /* Explicitly call target enter/pos cb, in order to calculate packing coords. */
2320 _drop_target_enter(wdg_container, NULL); 2334 _drop_target_enter(wdg_container, NULL);