yakov pushed a commit to branch master.

http://git.enlightenment.org/tools/erigo.git/commit/?id=b2c1a687ed0406580aba4ad01e9a280541f0c0ae

commit b2c1a687ed0406580aba4ad01e9a280541f0c0ae
Author: Yakov Goldberg <[email protected]>
Date:   Sun Dec 13 15:43:16 2015 +0200

    Don't drop selected widget when reloading canvas
    
    Now, when reloading canvas, selected widget will be kept.
    The same when switching contexts.
---
 src/bin/gui/editor.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/bin/gui/editor.c b/src/bin/gui/editor.c
index ec8b440..7feeafb 100644
--- a/src/bin/gui/editor.c
+++ b/src/bin/gui/editor.c
@@ -3238,12 +3238,10 @@ _editor_ctx_call(const Gui_Context *ctx)
         Gui_Session *session = (Gui_Session *) 
gui_context_editor_session_get(_active_context_get());
         manager_widget_create(session, wdg, NULL);
      }
-   /* During context call _win_resize() will be called.
-    * It will draw border around win, but widget was not selected yet.
-    * So need to hide border. */
-   _editor_wdg_selected_set(NULL);
-   proplayout_build(NULL);
-   objtree_item_selected_set(NULL);
+
+   const Gui_Widget *wdg = _editor_wdg_selected_get();
+   objtree_item_selected_set(wdg);
+   proplayout_build(wdg);
 
    return EINA_TRUE;
 }
@@ -4290,14 +4288,15 @@ _switch_to_context(Gui_Context *ctx)
    eo_do(g->main_win->toolbar_redo_it, 
elm_wdg_item_disabled_set(context_can_redo(ctx) ? EINA_FALSE : EINA_TRUE));
    eo_do(g->main_win->toolbar_undo_it, 
elm_wdg_item_disabled_set(context_can_undo(ctx) ? EINA_FALSE : EINA_TRUE));
 
-   Gui_Widget *wdg = gui_context_data_get(ctx, SELECTED_WDG);
-   _editor_wdg_selected_set(wdg);
-   objtree_item_selected_set(wdg);
    _canvas_resize_cb(NULL, g->main_win->canvas_scroller, NULL, NULL);
    _canvas_name_update(ctx, EINA_FALSE);
    Eina_Stringshare *theme_name = 
gui_context_edit_theme_name_get(_active_context_get());
    eo_do(g->main_win->theme_selector_hoversel, 
elm_obj_widget_part_text_set(NULL, THEME_NAME_GET(theme_name)));
    _theme_selector_hover_selected_cb(NULL, NULL, NULL, NULL);
+
+   Gui_Widget *wdg = gui_context_data_get(ctx, SELECTED_WDG);
+   _editor_wdg_selected_set(wdg);
+   objtree_item_selected_set(wdg);
 }
 
 static void

-- 


Reply via email to