From 3e860e9ba7f3d135aed408bae5ea6c8bd977ed79 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Sun, 9 Nov 2014 14:08:52 +0000 Subject: [PATCH 1/8] Adding simple build check and clean support to the CLI and main toolbar --- src/bin/edi_build_main.c | 21 ++++++++++++++++--- src/bin/edi_main.c | 44 +++++++++++++++++++++++++++++++++------- src/lib/edi_builder.c | 17 ++++++++++++++++ src/lib/edi_builder.h | 20 ++++++++++++++++++ 4 files changed, 92 insertions(+), 10 deletions(-) diff --git a/src/bin/edi_build_main.c b/src/bin/edi_build_main.c index 50a887a..893275c 100644 --- a/src/bin/edi_build_main.c +++ b/src/bin/edi_build_main.c @@ -40,7 +40,7 @@ _exe_del(void *d EINA_UNUSED, int t EINA_UNUSED, void *event_info EINA_UNUSED) static const Ecore_Getopt optdesc = { "edi_build", - "%prog [options]", + "%prog [options] [build-type]", PACKAGE_VERSION, COPYRIGHT, "BSD with advertisement clause", @@ -59,7 +59,7 @@ EAPI_MAIN int main(int argc EINA_UNUSED, char **argv EINA_UNUSED) { int args; - char path[PATH_MAX]; + char path[PATH_MAX], *build_type = NULL; Eina_Bool quit_option = EINA_FALSE; Ecore_Getopt_Value values[] = { @@ -102,11 +102,26 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED) goto exit; } + if (args < argc) + build_type = argv[args]; + if (!build_type) + build_type = "build"; + ecore_event_handler_add(ECORE_EXE_EVENT_DATA, _exe_data, NULL); ecore_event_handler_add(ECORE_EXE_EVENT_ERROR, _exe_data, NULL); ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _exe_del, NULL); - edi_builder_build(); + if (!strncmp("clean", build_type, 5)) + edi_builder_clean(); + else if (!strncmp("test", build_type, 4)) + edi_builder_test(); + else if (!strncmp("build", build_type, 5)) + edi_builder_build(); + else + { + fprintf(stderr, "Unrecognised build type - try build, test or clean.\n"); + goto end; + } ecore_main_loop_begin(); end: diff --git a/src/bin/edi_main.c b/src/bin/edi_main.c index 1912797..6385c3d 100644 --- a/src/bin/edi_main.c +++ b/src/bin/edi_main.c @@ -303,10 +303,10 @@ _tb_goto_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUS evas_object_show(popup); } -static void -_tb_build_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +static Eina_Bool +_edi_build_prep(Evas_Object *button) { - elm_toolbar_item_selected_set(elm_toolbar_selected_item_get(obj), EINA_FALSE); + elm_toolbar_item_selected_set(elm_toolbar_selected_item_get(button), EINA_FALSE); edi_consolepanel_clear(); edi_consolepanel_show(); @@ -314,11 +314,38 @@ _tb_build_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNU if (!edi_builder_can_build()) { edi_consolepanel_append_error_line("Cowardly refusing to build unknown project type."); + return EINA_FALSE; } - else - { - edi_builder_build(); - } + + return EINA_TRUE; +} + +static void +_tb_build_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +{ + if (_edi_build_prep(obj)) + edi_builder_build(); +} + +static void +_tb_test_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +{ + if (_edi_build_prep(obj)) + edi_builder_test(); +} +/* +static void +_tb_run_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +{ + if (_edi_build_prep(obj)) + edi_builder_run(); +} +*/ +static void +_tb_clean_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +{ + if (_edi_build_prep(obj)) + edi_builder_clean(); } static Evas_Object * @@ -357,6 +384,9 @@ edi_toolbar_setup(Evas_Object *win) elm_toolbar_item_separator_set(tb_it, EINA_TRUE); tb_it = elm_toolbar_item_append(tb, "system-run", "Build", _tb_build_cb, NULL); + tb_it = elm_toolbar_item_append(tb, "emblem-default", "Test", _tb_test_cb, NULL); +// tb_it = elm_toolbar_item_append(tb, "player-play", "Run", _tb_run_cb, NULL); + tb_it = elm_toolbar_item_append(tb, "edit-clear", "Clean", _tb_clean_cb, NULL); evas_object_show(tb); return tb; diff --git a/src/lib/edi_builder.c b/src/lib/edi_builder.c index 31a82bf..017e63f 100644 --- a/src/lib/edi_builder.c +++ b/src/lib/edi_builder.c @@ -50,3 +50,20 @@ edi_builder_build(void) _edi_builder_build_autogen(); } +EAPI void +edi_builder_test(void) +{ + chdir(edi_project_get()); + ecore_exe_pipe_run("make check", ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_PIPE_READ | + ECORE_EXE_PIPE_ERROR_LINE_BUFFERED | ECORE_EXE_PIPE_ERROR, NULL); +} + +EAPI void +edi_builder_clean(void) +{ + chdir(edi_project_get()); + ecore_exe_pipe_run("make clean", ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_PIPE_READ | + ECORE_EXE_PIPE_ERROR_LINE_BUFFERED | ECORE_EXE_PIPE_ERROR, NULL); +} + + diff --git a/src/lib/edi_builder.h b/src/lib/edi_builder.h index dcb8462..c8b0730 100644 --- a/src/lib/edi_builder.h +++ b/src/lib/edi_builder.h @@ -44,6 +44,26 @@ edi_builder_can_build(void); EAPI void edi_builder_build(void); +/** + * Run a test build for the current project. + * + * @see edi_builder_can_build(). + * + * @ingroup Builder + */ +EAPI void +edi_builder_test(void); + +/** + * Run a clean for the current project. + * + * @see edi_builder_can_build(). + * + * @ingroup Builder + */ +EAPI void +edi_builder_clean(void); + /** * @} */ From 361e67c57a570676a6d1e3e271049ef046a6bcb4 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Wed, 12 Nov 2014 23:43:18 +0000 Subject: [PATCH 2/8] Fix issue where console error items would not open when tapped --- src/bin/edi_main.c | 7 +++++-- src/lib/edi.c | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/bin/edi_main.c b/src/bin/edi_main.c index 6385c3d..b475512 100644 --- a/src/bin/edi_main.c +++ b/src/bin/edi_main.c @@ -411,16 +411,18 @@ _edi_exit(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info } EAPI Evas_Object * -edi_open(const char *path) +edi_open(const char *inputpath) { Evas_Object *win, *vbx, *content, *tb; const char *winname; + char *path; - if (!edi_project_set(path)) + if (!edi_project_set(inputpath)) { fprintf(stderr, "Project path must be a directory\n"); return NULL; } + path = realpath(inputpath, NULL); elm_need_ethumb(); elm_need_efreet(); @@ -451,6 +453,7 @@ edi_open(const char *path) evas_object_resize(win, 560 * elm_config_scale_get(), 420 * elm_config_scale_get()); evas_object_show(win); + free(path); return win; } diff --git a/src/lib/edi.c b/src/lib/edi.c index 8950a49..3c4aec4 100644 --- a/src/lib/edi.c +++ b/src/lib/edi.c @@ -79,7 +79,7 @@ edi_project_set(const char *path) { char *real = NULL; - real = realpath(real, NULL); + real = realpath(path, NULL); if (!_edi_path_isdir(path)) { free(real); @@ -89,7 +89,7 @@ edi_project_set(const char *path) if (_edi_project_path) eina_stringshare_del(_edi_project_path); - _edi_project_path = eina_stringshare_add(path); + _edi_project_path = eina_stringshare_add(real); free(real); return EINA_TRUE; } From 6c831a21735e52bb49bfc6ad8148905ad48090ef Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Tue, 18 Nov 2014 21:35:18 +0000 Subject: [PATCH 3/8] Fix potential crash when going to the line of a large file. It will not work first time, but that's a seperate issue --- src/bin/mainview/edi_mainview.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/mainview/edi_mainview.c b/src/bin/mainview/edi_mainview.c index f673bf7..4b513e5 100644 --- a/src/bin/mainview/edi_mainview.c +++ b/src/bin/mainview/edi_mainview.c @@ -559,7 +559,7 @@ edi_mainview_goto(int line) it = elm_naviframe_top_item_get(nf); content = elm_object_item_content_get(it); editor = (Edi_Editor *)evas_object_data_get(content, "editor"); - if (!content || line <= 0) + if (!content || !editor || line <= 0) return; _tb = elm_entry_textblock_get(editor->entry); From 2387ceac88681987a797e475f315a5fdf4fa025a Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Tue, 18 Nov 2014 23:46:24 +0000 Subject: [PATCH 4/8] Fix render test and an end of line corner case --- elm_code/lib/elm_code_widget.c | 2 +- elm_code/tests/elm_code_test_widget.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/elm_code/lib/elm_code_widget.c b/elm_code/lib/elm_code_widget.c index 9d44163..572fd3a 100644 --- a/elm_code/lib/elm_code_widget.c +++ b/elm_code/lib/elm_code_widget.c @@ -39,7 +39,7 @@ static void _elm_code_widget_fill_line_token(Evas_Textgrid_Cell *cells, int coun { int x; - for (x = start; x <= end && x < count; x++) + for (x = start; x <= end && x <= count; x++) { cells[x].fg = type; } diff --git a/elm_code/tests/elm_code_test_widget.c b/elm_code/tests/elm_code_test_widget.c index 27b867e..9f499ac 100644 --- a/elm_code/tests/elm_code_test_widget.c +++ b/elm_code/tests/elm_code_test_widget.c @@ -28,12 +28,12 @@ START_TEST (elm_code_widget_token_render_simple_test) elm_code_file_line_token_add(file, 1, 22+1, 23+1, ELM_CODE_TOKEN_TYPE_COMMENT); elm_code_widget_fill_line_tokens(cells, length, line); - _assert_cell_type(cells[0], ELM_CODE_TOKEN_TYPE_DEFAULT); - _assert_cell_type(cells[3], ELM_CODE_TOKEN_TYPE_DEFAULT); - _assert_cell_type(cells[5], ELM_CODE_TOKEN_TYPE_DEFAULT); - _assert_cell_type(cells[15], ELM_CODE_TOKEN_TYPE_COMMENT); - _assert_cell_type(cells[19], ELM_CODE_TOKEN_TYPE_DEFAULT); - _assert_cell_type(cells[22], ELM_CODE_TOKEN_TYPE_COMMENT); + _assert_cell_type(cells[1], ELM_CODE_TOKEN_TYPE_DEFAULT); + _assert_cell_type(cells[4], ELM_CODE_TOKEN_TYPE_DEFAULT); + _assert_cell_type(cells[6], ELM_CODE_TOKEN_TYPE_DEFAULT); + _assert_cell_type(cells[16], ELM_CODE_TOKEN_TYPE_COMMENT); + _assert_cell_type(cells[20], ELM_CODE_TOKEN_TYPE_DEFAULT); + _assert_cell_type(cells[23], ELM_CODE_TOKEN_TYPE_COMMENT); elm_code_free(code); } From df1d7def50eee7131c5d2d260f51d1225a8cff56 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Wed, 19 Nov 2014 22:35:01 +0000 Subject: [PATCH 5/8] Fix a memory corruption issue on some systems --- elm_code/lib/elm_code_widget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elm_code/lib/elm_code_widget.c b/elm_code/lib/elm_code_widget.c index 572fd3a..9d44163 100644 --- a/elm_code/lib/elm_code_widget.c +++ b/elm_code/lib/elm_code_widget.c @@ -39,7 +39,7 @@ static void _elm_code_widget_fill_line_token(Evas_Textgrid_Cell *cells, int coun { int x; - for (x = start; x <= end && x <= count; x++) + for (x = start; x <= end && x < count; x++) { cells[x].fg = type; } From 7bfce6aadc2b333b647fcc1a97b23bd73d51bfe9 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Wed, 19 Nov 2014 22:37:00 +0000 Subject: [PATCH 6/8] Fix minor issues I saw in passing --- elm_code/bin/elm_code_test_main.c | 2 +- elm_code/lib/elm_code.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/elm_code/bin/elm_code_test_main.c b/elm_code/bin/elm_code_test_main.c index 95a5214..be88874 100644 --- a/elm_code/bin/elm_code_test_main.c +++ b/elm_code/bin/elm_code_test_main.c @@ -113,7 +113,7 @@ elm_code_test_win_setup(void) Evas_Object *win; Evas_Object *vbox; - win = elm_win_util_standard_add("main", "Elm_code_test"); + win = elm_win_util_standard_add("main", "Elm_Code Test"); if (!win) return NULL; vbox = elm_box_add(win); diff --git a/elm_code/lib/elm_code.c b/elm_code/lib/elm_code.c index bd4a148..1c04f53 100644 --- a/elm_code/lib/elm_code.c +++ b/elm_code/lib/elm_code.c @@ -15,7 +15,7 @@ int _elm_code_lib_log_dom = -1; const Eo_Event_Description ELM_CODE_EVENT_LINE_SET_DONE = EO_EVENT_DESCRIPTION("line,set,done", ""); const Eo_Event_Description ELM_CODE_EVENT_FILE_LOAD_DONE = - EO_EVENT_DESCRIPTION("file, load,done", ""); + EO_EVENT_DESCRIPTION("file,load,done", ""); EAPI int elm_code_init(void) From a06a9ce43149c26a2c0fe24354c4feba75c0977a Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Wed, 19 Nov 2014 23:50:42 +0000 Subject: [PATCH 7/8] Moving the issues to phab --- TODO | 6 ------ 1 file changed, 6 deletions(-) diff --git a/TODO b/TODO index f70d9ad..6fc0162 100644 --- a/TODO +++ b/TODO @@ -15,12 +15,6 @@ This project is in heavy development, we are currenty working towards the * Compilation error message integrated in the flow of code * Cross reference for c, c++ and some scripting language -Bugs to fix: - -* Remember last project and allow new project to be loaded (new window or current) -* Remember position and size of windows and panels -* Monitor filesystem for changes and refresh file tree - The next phase is "Basic IDE" and it, along with other future phases are documented online at https://phab.enlightenment.org/w/edi/ From 22dc13effa61b2fcf0d44cbb97f98be8bfee378d Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Sat, 22 Nov 2014 15:56:16 +0000 Subject: [PATCH 8/8] Lay out the UI better so you can use with panels open Changing from panels to panes - have dividers that are moved around appropriately to simulate panel behaviour without hiding the contents of a file being edited. --- src/bin/edi_consolepanel.c | 4 +- src/bin/edi_filepanel.c | 2 +- src/bin/edi_logpanel.c | 2 +- src/bin/edi_main.c | 170 ++++++++++++++++++++++++++----------- 4 files changed, 126 insertions(+), 52 deletions(-) diff --git a/src/bin/edi_consolepanel.c b/src/bin/edi_consolepanel.c index f790d58..38152a6 100644 --- a/src/bin/edi_consolepanel.c +++ b/src/bin/edi_consolepanel.c @@ -308,7 +308,7 @@ void edi_consolepanel_add(Evas_Object *parent) _console_box = vbx; - elm_object_content_set(parent, scroll); + elm_box_pack_end(parent, scroll); ecore_event_handler_add(ECORE_EXE_EVENT_DATA, _exe_data, NULL); ecore_event_handler_add(ECORE_EXE_EVENT_ERROR, _exe_error, NULL); @@ -329,6 +329,6 @@ void edi_testpanel_add(Evas_Object *parent) evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(widget); - elm_object_content_set(parent, widget); + elm_box_pack_end(parent, widget); } diff --git a/src/bin/edi_filepanel.c b/src/bin/edi_filepanel.c index 7bfc1af..6e3600f 100644 --- a/src/bin/edi_filepanel.c +++ b/src/bin/edi_filepanel.c @@ -370,5 +370,5 @@ edi_filepanel_add(Evas_Object *parent, Evas_Object *win, _main_win = win; _populate(list, path, NULL, NULL); - elm_object_content_set(parent, list); + elm_box_pack_end(parent, list); } diff --git a/src/bin/edi_logpanel.c b/src/bin/edi_logpanel.c index c065fb5..48bb370 100644 --- a/src/bin/edi_logpanel.c +++ b/src/bin/edi_logpanel.c @@ -55,5 +55,5 @@ void edi_logpanel_add(Evas_Object *parent) eina_log_print_cb_set(print_cb, NULL); eina_log_color_disable_set(EINA_TRUE); - elm_object_content_set(parent, widget); + elm_box_pack_end(parent, widget); } diff --git a/src/bin/edi_main.c b/src/bin/edi_main.c index ebc2a2b..0ebf51d 100644 --- a/src/bin/edi_main.c +++ b/src/bin/edi_main.c @@ -23,7 +23,12 @@ #define COPYRIGHT "Copyright © 2014 Andy Williams and various contributors (see AUTHORS)." -static Evas_Object *_edi_filepanel, *_edi_logpanel, *_edi_consolepanel, *_edi_testpanel; +static Evas_Object *_edi_leftpanes, *_edi_bottompanes; +static Evas_Object *_edi_logpanel, *_edi_consolepanel, *_edi_testpanel; +static Elm_Object_Item *_edi_logpanel_item, *_edi_consolepanel_item, *_edi_testpanel_item; +static Elm_Object_Item *_edi_selected_bottompanel; +static Evas_Object *_edi_filepanel, *_edi_filepanel_icon; + static Evas_Object *_edi_main_win, *_edi_new_popup, *_edi_goto_popup; static void @@ -46,40 +51,101 @@ _edi_file_open_cb(const char *path, const char *type, Eina_Bool newwin) } static void -_edi_toggle_panel(void *data, Evas_Object *obj, - void *event_info EINA_UNUSED) +_edi_toggle_file_panel(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - elm_object_focus_set(obj, EINA_FALSE); - elm_panel_toggle((Evas_Object *) data); + Evas_Object *panel; + double size; + + panel = (Evas_Object *)data; + size = elm_panes_content_left_size_get(_edi_leftpanes); + + if (size == 0.0) + { + evas_object_show(panel); + elm_icon_standard_set(_edi_filepanel_icon, "stock_left"); + elm_panes_content_left_size_set(_edi_leftpanes, 0.25); + } + else + { + elm_icon_standard_set(_edi_filepanel_icon, "stock_right"); + elm_panes_content_left_size_set(_edi_leftpanes, 0.0); + evas_object_hide(panel); + } +} + +static void +_edi_toggle_panel(void *data, Evas_Object *obj, void *event_info) +{ + double size; + Elm_Object_Item *item; + Evas_Object *panel; + + panel = (Evas_Object *) data; + item = (Elm_Object_Item *) event_info; + if (obj) + elm_object_focus_set(obj, EINA_FALSE); + + evas_object_hide(_edi_logpanel); + evas_object_hide(_edi_consolepanel); + evas_object_hide(_edi_testpanel); + + if (item == _edi_selected_bottompanel) + { + elm_toolbar_item_icon_set(item, "stock_up"); + elm_panes_content_right_size_set(_edi_bottompanes, 0.0); + + _edi_selected_bottompanel = NULL; + elm_toolbar_item_selected_set(item, EINA_FALSE); + } + else + { + if (_edi_selected_bottompanel) + elm_toolbar_item_icon_set(_edi_selected_bottompanel, "stock_up"); + + elm_toolbar_item_icon_set(item, "stock_down"); + evas_object_show(panel); + + size = elm_panes_content_right_size_get(_edi_bottompanes); + if (size == 0.0) + elm_panes_content_right_size_set(_edi_bottompanes, 0.2); + + _edi_selected_bottompanel = item; + elm_toolbar_item_selected_set(item, EINA_TRUE); + } + elm_toolbar_select_mode_set(obj, ELM_OBJECT_SELECT_MODE_ALWAYS); } void edi_consolepanel_show() { - elm_panel_hidden_set(_edi_consolepanel, EINA_FALSE); + elm_toolbar_item_selected_set(_edi_consolepanel_item, EINA_TRUE); } void edi_testpanel_show() { - elm_panel_hidden_set(_edi_testpanel, EINA_FALSE); + elm_toolbar_item_selected_set(_edi_testpanel_item, EINA_TRUE); } static Evas_Object * edi_content_setup(Evas_Object *win, const char *path) { - Evas_Object *panes, *content_out, *content_in, *tb, *button; + Evas_Object *filepane, *logpane, *logpanels, *content_out, *content_in, *tb; + Evas_Object *icon, *button; - panes = elm_table_add(win); - evas_object_size_hint_weight_set(panes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + filepane = elm_panes_add(win); + evas_object_size_hint_weight_set(filepane, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + logpane = elm_panes_add(filepane); + elm_panes_horizontal_set(logpane, EINA_TRUE); + evas_object_size_hint_weight_set(logpane, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - _edi_filepanel = elm_panel_add(win); - _edi_logpanel = elm_panel_add(win); - _edi_consolepanel = elm_panel_add(win); - _edi_testpanel = elm_panel_add(win); + _edi_filepanel = elm_box_add(win); + _edi_logpanel = elm_box_add(win); + _edi_consolepanel = elm_box_add(win); + _edi_testpanel = elm_box_add(win); // add main content content_out = elm_box_add(win); elm_box_horizontal_set(content_out, EINA_FALSE); - evas_object_size_hint_weight_set(content_out, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_weight_set(content_out, 0.8, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(content_out, EVAS_HINT_FILL, EVAS_HINT_FILL); content_in = elm_box_add(content_out); @@ -87,10 +153,15 @@ edi_content_setup(Evas_Object *win, const char *path) evas_object_size_hint_weight_set(content_in, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(content_in, EVAS_HINT_FILL, EVAS_HINT_FILL); + icon = elm_icon_add(content_in); + elm_icon_standard_set(icon, "stock_left"); button = elm_button_add(content_in); - elm_object_text_set(button, " "); + elm_object_part_content_set(button, "icon", icon); + elm_object_focus_allow_set(button, EINA_FALSE); + _edi_filepanel_icon = icon; + evas_object_smart_callback_add(button, "clicked", - _edi_toggle_panel, _edi_filepanel); + _edi_toggle_file_panel, _edi_filepanel); evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(content_in, button); evas_object_show(button); @@ -99,69 +170,72 @@ edi_content_setup(Evas_Object *win, const char *path) edi_mainview_add(content_in, win); evas_object_show(content_in); - elm_table_pack(panes, content_out, 0, 0, 6, 5); - evas_object_show(content_out); + elm_object_part_content_set(filepane, "right", content_out); + elm_object_part_content_set(logpane, "top", filepane); + evas_object_show(logpane); + _edi_leftpanes = filepane; // add file list - elm_panel_orient_set(_edi_filepanel, ELM_PANEL_ORIENT_LEFT); - evas_object_size_hint_weight_set(_edi_filepanel, 0.3, EVAS_HINT_EXPAND); + evas_object_size_hint_weight_set(_edi_filepanel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(_edi_filepanel, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_panes_content_left_size_set(filepane, 0.25); - elm_panel_hidden_set(_edi_filepanel, EINA_FALSE); edi_filepanel_add(_edi_filepanel, win, path, _edi_file_open_cb); - elm_table_pack(panes, _edi_filepanel, 0, 0, 1, 5); + elm_object_part_content_set(filepane, "left", _edi_filepanel); evas_object_show(_edi_filepanel); - // add lower panel + // add lower panel buttons tb = elm_toolbar_add(content_out); evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_toolbar_homogeneous_set(tb, EINA_FALSE); elm_toolbar_align_set(tb, 1.0); + elm_toolbar_icon_size_set(tb, 14); + elm_object_style_set(tb, "item_horizontal"); + elm_object_focus_allow_set(tb, EINA_FALSE); elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_SCROLL); - elm_toolbar_select_mode_set(tb, ELM_OBJECT_SELECT_MODE_ALWAYS); + elm_toolbar_select_mode_set(tb, ELM_OBJECT_SELECT_MODE_DEFAULT); elm_box_pack_end(content_out, tb); evas_object_show(tb); - elm_toolbar_item_append(tb, NULL, "Logs", _edi_toggle_panel, _edi_logpanel); - elm_toolbar_item_append(tb, NULL, "Console", _edi_toggle_panel, _edi_consolepanel); - elm_toolbar_item_append(tb, NULL, "Tests", _edi_toggle_panel, _edi_testpanel); + _edi_logpanel_item = elm_toolbar_item_append(tb, "stock_up", "Logs", + _edi_toggle_panel, _edi_logpanel); + _edi_consolepanel_item = elm_toolbar_item_append(tb, "stock_up", "Console", + _edi_toggle_panel, _edi_consolepanel); + _edi_testpanel_item = elm_toolbar_item_append(tb, "stock_up", "Tests", + _edi_toggle_panel, _edi_testpanel); - elm_panel_orient_set(_edi_logpanel, ELM_PANEL_ORIENT_BOTTOM); - evas_object_size_hint_weight_set(_edi_logpanel, EVAS_HINT_EXPAND, 0.15); + // add lower panel panes + logpanels = elm_table_add(logpane); + evas_object_size_hint_weight_set(_edi_logpanel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(_edi_logpanel, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(_edi_logpanel); - elm_panel_hidden_set(_edi_logpanel, EINA_FALSE); - elm_panel_hidden_set(_edi_logpanel, EINA_TRUE); edi_logpanel_add(_edi_logpanel); - elm_table_pack(panes, _edi_logpanel, 0, 4, 6, 1); - evas_object_show(_edi_logpanel); + elm_table_pack(logpanels, _edi_logpanel, 0, 0, 1, 1); + evas_object_hide(_edi_logpanel); - elm_panel_orient_set(_edi_consolepanel, ELM_PANEL_ORIENT_BOTTOM); - evas_object_size_hint_weight_set(_edi_consolepanel, EVAS_HINT_EXPAND, 0.15); + evas_object_size_hint_weight_set(_edi_consolepanel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(_edi_consolepanel, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(_edi_consolepanel); - elm_panel_hidden_set(_edi_consolepanel, EINA_FALSE); - elm_panel_hidden_set(_edi_consolepanel, EINA_TRUE); edi_consolepanel_add(_edi_consolepanel); - elm_table_pack(panes, _edi_consolepanel, 0, 4, 6, 1); - evas_object_show(_edi_consolepanel); + elm_table_pack(logpanels, _edi_consolepanel, 0, 0, 1, 1); + evas_object_hide(_edi_consolepanel); - elm_panel_orient_set(_edi_testpanel, ELM_PANEL_ORIENT_BOTTOM); - evas_object_size_hint_weight_set(_edi_testpanel, EVAS_HINT_EXPAND, 0.15); + evas_object_size_hint_weight_set(_edi_testpanel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(_edi_testpanel, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(_edi_testpanel); - elm_panel_hidden_set(_edi_testpanel, EINA_FALSE); - elm_panel_hidden_set(_edi_testpanel, EINA_TRUE); edi_testpanel_add(_edi_testpanel); - elm_table_pack(panes, _edi_testpanel, 0, 4, 6, 1); - evas_object_show(_edi_testpanel); + elm_table_pack(logpanels, _edi_testpanel, 0, 0, 1, 1); + elm_object_part_content_set(logpane, "bottom", logpanels); + elm_panes_content_right_size_set(logpane, 0.0); + evas_object_hide(_edi_testpanel); + evas_object_show(logpane); + _edi_bottompanes = logpane; - evas_object_show(panes); - return panes; + return logpane; } static void