yakov pushed a commit to branch master. http://git.enlightenment.org/tools/erigo.git/commit/?id=fcd1ebe72c701286727bb32a3884450612e0bd63
commit fcd1ebe72c701286727bb32a3884450612e0bd63 Author: Yakov Goldberg <yako...@samsung.com> Date: Wed Apr 15 14:45:28 2015 +0300 Fix stacking of elements and borders on canvas --- src/bin/egui_gui/editor.c | 25 ++++++++++++++++++++----- src/bin/egui_gui/egui_layout.json | 3 ++- src/bin/egui_gui/egui_logic.c | 3 +++ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/bin/egui_gui/editor.c b/src/bin/egui_gui/editor.c index 1122544..cfacb0c 100644 --- a/src/bin/egui_gui/editor.c +++ b/src/bin/egui_gui/editor.c @@ -78,6 +78,14 @@ _active_context_get() return _active_ctx; } +/* Use this function to stack frames and border's lines and markers below panes. */ +static void +_stack_below_panes(Eo *obj) +{ + eo_do(obj, efl_gfx_stack_below(g->main_win->right_panes)); + eo_do(obj, efl_gfx_stack_below(g->main_win->left_panes)); +} + typedef enum { BORDER_OUT = 0, BORDER_LEFT = 1 << 0, @@ -230,13 +238,14 @@ enum }\ if (base_obj == canvas_get())\ {\ - eo_do(evas_object_smart_parent_get(g->main_win->main_box), evas_obj_smart_member_add(line)); \ + eo_do(evas_object_smart_parent_get(g->main_win->left_panes), evas_obj_smart_member_add(line)); \ }\ }\ eo_do(line, efl_gfx_visible_set(visibility));\ eo_do(line, efl_gfx_position_set(x, y));\ eo_do(line, efl_gfx_size_set(l, w));\ eo_do(line, efl_gfx_stack_raise());\ + if (base_obj == canvas_get()) _stack_below_panes(line);\ }) #define MARKER(base_obj, id, x, y, visibility) \ @@ -254,12 +263,12 @@ enum eo_do(_m, eo_event_callback_add(EVAS_OBJECT_EVENT_MOUSE_OUT, _marker_mouse_out, (void *) (intptr_t) id)); \ if (base_obj == canvas_get())\ {\ - eo_do(evas_object_smart_parent_get(base_obj), evas_obj_smart_member_add(_m)); \ + eo_do(evas_object_smart_parent_get(g->main_win->left_panes), evas_obj_smart_member_add(_m)); \ }\ }\ eo_do(_m, efl_gfx_position_set(x, y)); \ - eo_do(_m, efl_gfx_stack_raise());\ eo_do(_m, efl_gfx_visible_set(visibility));\ + if (base_obj == canvas_get()) _stack_below_panes(_m);\ }) /* Draws border around obj, Evas is taken from base_obj; @@ -432,6 +441,7 @@ _editor_wdg_selected_set(const Gui_Widget *wdg) Main_Wdg_Info *wi = wdg_data_get(main_wdg, MAIN_WDG_INFO); Eo *fr = main_wdg_info_frame_get(wi); eo_do(fr, efl_gfx_stack_raise()); + _stack_below_panes(fr); Eo *obj = session_eo_get(gui_context_editor_session_get(ctx), wdg); /* Set focus */ @@ -2416,11 +2426,16 @@ _widget_add(Gui_Session *session, const Gui_Widget *wdg, void *data) Evas_Coord x, y, x_par, y_par; fr = eo_add(ELM_FRAME_CLASS, parent_win); - /* This frame does not have any smart as parent. So in order to show menu above the frame, + /* This frame does not have any smart as parent. So in order to show the frame under panes. * we add this frame as a member of smart object. */ + if (fr) + { + Eo *smart_parent = evas_object_smart_parent_get(g->main_win->left_panes); + eo_do(smart_parent, evas_obj_smart_member_add(fr)); + _stack_below_panes(fr); + } Eo *smart_parent = evas_object_smart_parent_get(g->main_win->main_box); - eo_do(smart_parent, evas_obj_smart_member_add(fr)); eo_do(smart_parent, efl_gfx_position_get(&x_par, &y_par)); /* If widget was DnD'ed from factory, these fields won't be empty... */ diff --git a/src/bin/egui_gui/egui_layout.json b/src/bin/egui_gui/egui_layout.json index 9effe16..105e887 100644 --- a/src/bin/egui_gui/egui_layout.json +++ b/src/bin/egui_gui/egui_layout.json @@ -1007,7 +1007,8 @@ "Desc": { "parent":"main_win", - "class":"Elm_Box" + "class":"Elm_Box", + "public":true }, "Properties": { diff --git a/src/bin/egui_gui/egui_logic.c b/src/bin/egui_gui/egui_logic.c index 4c2fd8e..4abc7ac 100644 --- a/src/bin/egui_gui/egui_logic.c +++ b/src/bin/egui_gui/egui_logic.c @@ -932,6 +932,9 @@ egui_start() eo_do(evas_object_smart_parent_get(g_main_wdgs->main_win->main_box), evas_obj_smart_member_add(g_main_wdgs->main_win->canvas_bg)); eo_do(g_main_wdgs->main_win->canvas_bg, efl_gfx_stack_below(g_main_wdgs->main_win->main_box)); + /* hor box and toolbar are in the same main_box and he the same parent smart obj. + * So stack hor_box under toolbar. */ + eo_do(g_main_wdgs->main_win->hor_box, efl_gfx_stack_below(g_main_wdgs->main_win->toolbar)); //Eo *mmenu; //eo_do(g_main_wdgs->main_win->main_win, elm_obj_win_main_menu_get(&mmenu)); //eo_do(mmenu, elm_obj_menu_item_add(NULL, NULL, "OPEN", NULL, NULL, NULL)); --