summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2014-12-04 11:19:48 +0200
committerYakov Goldberg <yakov.g@samsung.com>2014-12-04 12:16:42 +0200
commit5f406b9af5f555d89f3fbd34f0e2678f154b3fca (patch)
tree4681b8196da48d12d138e7706fb1aff332884a76 /src/bin
parentfe0f4596a371e3ba026653d10530806c4e4fc6b6 (diff)
Fix resizing of main objects
One of main changes: - commenting out setting of main wdg as resize object, because it causes strange resizing behaviour when openning project. Maybe need check it more properly.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/egui_gui/editor.c53
1 files changed, 36 insertions, 17 deletions
diff --git a/src/bin/egui_gui/editor.c b/src/bin/egui_gui/editor.c
index 8af4379..5b5f9a0 100644
--- a/src/bin/egui_gui/editor.c
+++ b/src/bin/egui_gui/editor.c
@@ -645,24 +645,28 @@ _marker_mouse_move(void *data, Eo *marker EINA_UNUSED, const Eo_Event_Descriptio
645 Gui_Value *val; 645 Gui_Value *val;
646 646
647 prop = wdg_prop_get(wdg, DB_DEF_EVAS_OBJECT_CLASS, SIZE_SET); 647 prop = wdg_prop_get(wdg, DB_DEF_EVAS_OBJECT_CLASS, SIZE_SET);
648 if (prop) 648 if (!prop)
649 { 649 {
650 Evas_Coord dw, dh; 650 Op_Desc *op = db_mro_op_desc_get(wdg_class_name_get(wdg), DB_DEF_EVAS_OBJECT_CLASS, SIZE_SET);
651 eo_do(weo, dw = (Evas_Coord) (intptr_t) eo_key_data_get("dw")); 651 prop = prop_create_for_op(op);
652 eo_do(weo, dh = (Evas_Coord) (intptr_t) eo_key_data_get("dh")); 652 wdg_prop_add((Gui_Widget *) wdg, prop);
653 /* ow and oh are frame's sizes, we need to subtract delta,
654 * to get window's size.*/
655 ow = ow - dw;
656 oh = oh - dh;
657
658 val = prop_value_nth_get(prop, 0);
659 gui_value_int_set(val, ow);
660 val = prop_value_nth_get(prop, 1);
661 gui_value_int_set(val, oh);
662 propview_item_update(prop);
663 /* win has size prop, so move it through manager*/
664 manager_widget_property_add(session, wdg, prop, MODE_EDITOR, NULL);
665 } 653 }
654
655 Evas_Coord dw, dh;
656 eo_do(weo, dw = (Evas_Coord) (intptr_t) eo_key_data_get("dw"));
657 eo_do(weo, dh = (Evas_Coord) (intptr_t) eo_key_data_get("dh"));
658 /* ow and oh are frame's sizes, we need to subtract delta,
659 * to get window's size.*/
660 ow = ow - dw;
661 oh = oh - dh;
662
663 val = prop_value_nth_get(prop, 0);
664 gui_value_int_set(val, ow);
665 val = prop_value_nth_get(prop, 1);
666 gui_value_int_set(val, oh);
667 propview_item_update(prop);
668 /* win has size prop, so move it through manager*/
669 manager_widget_property_add(session, wdg, prop, MODE_EDITOR, NULL);
666 /* If main_wdg is not win, need to get it's win inlined image and resize.*/ 670 /* If main_wdg is not win, need to get it's win inlined image and resize.*/
667 if (!IS_WIN(wdg)) 671 if (!IS_WIN(wdg))
668 { 672 {
@@ -911,6 +915,14 @@ _win_resize(void *data EINA_UNUSED, Eo *o, const Eo_Event_Description *desc EINA
911 /* FIXME: comment it? */ 915 /* FIXME: comment it? */
912 eo_do(inwin_img, evas_obj_size_set(ow, oh)); 916 eo_do(inwin_img, evas_obj_size_set(ow, oh));
913 } 917 }
918 /* For main objects, which are not win. */
919 else
920 {
921 Eo *optional_win = eo_do(o, eo_key_data_get("__editor_win"));
922 Eo *inwin_img = elm_win_inlined_image_object_get(optional_win);
923 eo_do(optional_win, evas_obj_size_set(ow, oh));
924 eo_do(inwin_img, evas_obj_size_set(ow, oh));
925 }
914 eo_do(o, fr = eo_key_data_get("__editor_frame")); 926 eo_do(o, fr = eo_key_data_get("__editor_frame"));
915 927
916 intptr_t dw, dh; 928 intptr_t dw, dh;
@@ -1733,7 +1745,7 @@ _widget_add(Gui_Session *session, const Gui_Widget *wdg, void *data)
1733 { 1745 {
1734 Eo *o = _ffi_eo_add(session, wdg, win); 1746 Eo *o = _ffi_eo_add(session, wdg, win);
1735 if (!o) return EINA_FALSE; 1747 if (!o) return EINA_FALSE;
1736 eo_do(win, elm_obj_win_resize_object_add(o)); 1748 //eo_do(win, elm_obj_win_resize_object_add(o));
1737 eo_do(o, eo_key_data_set("__editor_win", win, NULL)); 1749 eo_do(o, eo_key_data_set("__editor_win", win, NULL));
1738 session_eo_set(session, wdg, o); 1750 session_eo_set(session, wdg, o);
1739 } 1751 }
@@ -1804,6 +1816,13 @@ _widget_add(Gui_Session *session, const Gui_Widget *wdg, void *data)
1804 elm_object_content_set(fr, iwin); 1816 elm_object_content_set(fr, iwin);
1805 1817
1806 eo_do(win, eo_event_callback_add(EVAS_OBJECT_EVENT_RESIZE, _win_resize, NULL)); 1818 eo_do(win, eo_event_callback_add(EVAS_OBJECT_EVENT_RESIZE, _win_resize, NULL));
1819 /* If main object is not a win, add callback on resize event.
1820 * So when size will be changed in propview, win will be resized. */
1821 if (!IS_WIN(wdg))
1822 {
1823 Eo *o = session_eo_get(session, wdg);
1824 eo_do(o, eo_event_callback_add(EVAS_OBJECT_EVENT_RESIZE, _win_resize, NULL));
1825 }
1807 /* Get size from properties of window. */ 1826 /* Get size from properties of window. */
1808 Evas_Coord ox = 150, oy = 50; 1827 Evas_Coord ox = 150, oy = 50;
1809 eo_do(fr, evas_obj_position_get(&ox, &oy)); 1828 eo_do(fr, evas_obj_position_get(&ox, &oy));