From a033aa1de97626fbdb9b79149e3d2bd42a2acd3d Mon Sep 17 00:00:00 2001 From: Alastair Poole Date: Sat, 21 Dec 2019 02:37:54 +0000 Subject: [PATCH] Revert "toolbar: experiment" This reverts commit ecd065e358d06d01274a666378ada0cfc0b43c97. --- src/bin/edi_main.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/bin/edi_main.c b/src/bin/edi_main.c index 82f8a22..6788203 100644 --- a/src/bin/edi_main.c +++ b/src/bin/edi_main.c @@ -1339,24 +1339,20 @@ _edi_toolbar_item_add(Evas_Object *tb, const char *icon, const char *name, Evas_ } static Evas_Object * -edi_toolbar_setup(void) +edi_toolbar_setup(Evas_Object *parent) { - Evas_Object *win, *tb; + Evas_Object *tb; Elm_Object_Item *tb_it; - win = elm_win_add(edi_main_win_get(), "bar", ELM_WIN_BASIC); - elm_win_focus_highlight_enabled_set(win, EINA_FALSE); - evas_object_show(win); - - tb = elm_toolbar_add(win); - elm_toolbar_horizontal_set(tb, EINA_FALSE); + tb = elm_toolbar_add(parent); + elm_toolbar_horizontal_set(tb, EINA_TRUE); elm_toolbar_homogeneous_set(tb, EINA_TRUE); elm_toolbar_align_set(tb, 0.0); elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_SCROLL); elm_toolbar_select_mode_set(tb, ELM_OBJECT_SELECT_MODE_NONE); elm_toolbar_homogeneous_set(tb, EINA_TRUE); elm_object_focus_allow_set(tb, EINA_FALSE); - evas_object_size_hint_align_set(tb, 0, EVAS_HINT_FILL); + evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(tb, 0.5, 0.0); _edi_toolbar_item_add(tb, "document-new", _("New File"), _tb_new_cb); @@ -1387,7 +1383,6 @@ edi_toolbar_setup(void) _edi_toolbar_item_add(tb, "help-about", _("About"), _tb_about_cb); evas_object_show(tb); - elm_object_content_set(win, tb); return tb; } @@ -1608,7 +1603,7 @@ edi_open(const char *inputpath) hbx = elm_box_add(win); _edi_main_box = hbx; - elm_box_horizontal_set(hbx, EINA_TRUE); + elm_box_horizontal_set(hbx, EINA_FALSE); evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(hbx, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(hbx); @@ -1626,9 +1621,9 @@ edi_open(const char *inputpath) edi_theme_window_alpha_set(); - tb = edi_toolbar_setup(); + tb = edi_toolbar_setup(hbx); - //_edi_toolbar = tb; + _edi_toolbar = tb; _edi_toolbar_visible_set(!_edi_project_config->gui.toolbar_hidden); _edi_menu_setup(win); @@ -1636,6 +1631,7 @@ edi_open(const char *inputpath) content = edi_content_setup(hbx, path); evas_object_size_hint_weight_set(content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(content, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_box_pack_end(hbx, tb); elm_box_pack_end(hbx, content); _edi_config_project_add(path);