yakov pushed a commit to branch master. http://git.enlightenment.org/tools/erigo.git/commit/?id=4f988268ab382516952daf354407d990e031bac2
commit 4f988268ab382516952daf354407d990e031bac2 Author: Yakov Goldberg <yako...@samsung.com> Date: Sun Apr 19 16:22:09 2015 +0300 Implement left and right panes with layout and edje Add layout with edje into left and right panes. And then put backgrounds and vertical panes into swallow. --- CMakeLists.txt | 1 + data/layouts/CMakeLists.txt | 25 +++++++++++ data/layouts/panes_layout.edc | 17 ++++++++ src/bin/egui_gui/CMakeLists.txt | 4 +- src/bin/egui_gui/egui_layout.json | 89 +++++++++++++++++++++++++++++++++++---- 5 files changed, 126 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d94329..7ed2f5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,3 +75,4 @@ add_subdirectory(src/bin) add_subdirectory(src/tests) add_subdirectory(data/images) add_subdirectory(data/config) +add_subdirectory(data/layouts) diff --git a/data/layouts/CMakeLists.txt b/data/layouts/CMakeLists.txt new file mode 100644 index 0000000..fab7001 --- /dev/null +++ b/data/layouts/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 2.8.1) + +LIST(APPEND LAYOUTS + panes_layout.edj + ) + + +execute_process(COMMAND edje_cc panes_layout.edc + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + RESULT_VARIABLE res) + +if (${res} EQUAL 0) + message(STATUS "Edje layout compiled") +else() + message(STATUS "Failed to compile edje layout") +endif () + +if (${EGUI_IS_RELEASE}) + install (FILES ${LAYOUTS} DESTINATION share/${PROJECT_NAME_LOWER}/layouts) +elseif (NOT ${EGUI_IS_RELEASE}) + foreach (f ${LAYOUTS}) + configure_file(${f} ${CMAKE_CURRENT_BINARY_DIR}/${f} COPYONLY) + endforeach(f) +endif (${EGUI_IS_RELEASE}) + diff --git a/data/layouts/panes_layout.edc b/data/layouts/panes_layout.edc new file mode 100644 index 0000000..03944b3 --- /dev/null +++ b/data/layouts/panes_layout.edc @@ -0,0 +1,17 @@ +collections{ + group { name: "elm/layout/panes/pane"; + parts { + part { name: "erigo.swallow.bg"; + type: SWALLOW; + scale: 1; + description { state: "default" 0; + } + } + part { name: "erigo.swallow.content"; + type: SWALLOW; + description { state: "default" 0; + } + } + } + } +} diff --git a/src/bin/egui_gui/CMakeLists.txt b/src/bin/egui_gui/CMakeLists.txt index d8e4bd7..41f1e59 100644 --- a/src/bin/egui_gui/CMakeLists.txt +++ b/src/bin/egui_gui/CMakeLists.txt @@ -19,9 +19,11 @@ link_directories (${PC_LIBELEMENTARY_LIBRARY_DIRS}) if (${EGUI_IS_RELEASE}) set(PACKAGE_DATA_DIR_DEFINITION PACKAGE_DATA_DIR="${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}") set(PACKAGE_IMAGES_DIR_DEFINITION EGUI_LAYOUT_IMAGES_PATH="${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}/images") + set(PACKAGE_EDJE_DIR_DEFINITION EGUI_LAYOUT_EDJE_PATH="${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}/layouts") elseif (NOT ${EGUI_IS_RELEASE}) set(PACKAGE_DATA_DIR_DEFINITION PACKAGE_DATA_DIR="${CMAKE_BINARY_DIR}/data") set(PACKAGE_IMAGES_DIR_DEFINITION EGUI_LAYOUT_IMAGES_PATH="${CMAKE_BINARY_DIR}/data/images") + set(PACKAGE_EDJE_DIR_DEFINITION EGUI_LAYOUT_EDJE_PATH="${CMAKE_BINARY_DIR}/data/layouts") endif(${EGUI_IS_RELEASE}) #add -DGUI_MODE to build gui executable @@ -75,7 +77,7 @@ add_executable(${TARGET} add_dependencies(${TARGET} erigo_cmd) set_property(TARGET ${TARGET} - PROPERTY COMPILE_DEFINITIONS ${PACKAGE_DATA_DIR_DEFINITION} ${PACKAGE_IMAGES_DIR_DEFINITION}) + PROPERTY COMPILE_DEFINITIONS ${PACKAGE_DATA_DIR_DEFINITION} ${PACKAGE_IMAGES_DIR_DEFINITION} ${PACKAGE_EDJE_DIR_DEFINITION}) target_link_libraries (${TARGET} guiparser diff --git a/src/bin/egui_gui/egui_layout.json b/src/bin/egui_gui/egui_layout.json index 105e887..3a42411 100644 --- a/src/bin/egui_gui/egui_layout.json +++ b/src/bin/egui_gui/egui_layout.json @@ -11,8 +11,8 @@ { "res_canvas_bg":"data/images/canvas_bg.jpg", "erigo_icon":"data/images/erigo_icon.png", - "move_up_icon":"/home/yakov/erigo/data/images/icon_up_arrow.png", - "move_down_icon":"/home/yakov/erigo/data/images/icon_down_arrow.png" + "move_up_icon":"data/images/icon_up_arrow.png", + "move_down_icon":"data/images/icon_down_arrow.png" }, "Eo_Callbacks": { @@ -36,6 +36,10 @@ "_contentview_del_btn_clicked":"_contentview_del_btn_clicked", "_itemview_up_btn_clicked":"_itemview_up_btn_clicked", "_itemview_down_btn_clicked":"_itemview_down_btn_clicked" + }, + "Edjes": + { + "panes_layout":["data/layouts/panes_layout.edj", ""] } }, "Widgets": @@ -1019,6 +1023,25 @@ }, "Contains":["left_panes", "right_panes"] }, + "left_pane_layout": + { + "Desc": + { + "parent":"left_panes", + "class":"Elm_Layout" + }, + "Properties": + { + "Evas.Object.size_hint_weight":[1, 1], + "Efl.Gfx.Base.visible":[true], + "Efl.File.file":["panes_layout", "elm/layout/panes/pane"] + }, + "Contains": + { + "left_pane_bg":["erigo.swallow.bg"], + "left_panel_box":["erigo.swallow.content"] + } + }, "left_panes": { "Desc": @@ -1035,14 +1058,27 @@ }, "Contains": { - "left_panel_box":["left"] + "left_pane_layout":["left"] + } + }, + "left_pane_bg": + { + "Desc": + { + "parent":"left_pane_layout", + "class":"Elm_Bg" + }, + "Properties": + { + "Evas.Object.size_hint_weight":[1, 1], + "Efl.Gfx.Base.visible":[true] } }, "left_panel_box": { "Desc": { - "parent":"left_panes", + "parent":"left_pane_layout", "class":"Elm_Box", "public":true }, @@ -1086,7 +1122,7 @@ "Evas.Object.size_hint_align":[-1, 0], "Efl.Gfx.Base.visible":[true] }, - "Contains":["fctr_table_sep_0", "fctr_table_label_1", "fctr_table_sep_1", "fctr_table", "fctr_table_sep_2","fctr_table_label_2", "fctr_table_sep_3", "fctr_table_containers", "fctr_table_sep_4", "fctr_table_label_3", "fctr_table_sep_5","fctr_table_item_widgets", "fctr_table_sep_6", "fctr_table_label_4", "fctr_table_sep_7", "fctr_table_evas"] + "Contains":["fctr_table_sep_0", "fctr_table_label_1", "fctr_table_sep_1", "fctr_table", "fctr_table_sep_2", "fctr_table_label_2", "fctr_table_sep_3", "fctr_table_containers", "fctr_table_sep_4", "fctr_table_label_3", "fctr_table_sep_5", "fctr_table_item_widgets", "fctr_table_sep_6", "fctr_table_label_4", "fctr_table_sep_7", "fctr_table_evas"] }, "fctr_table_sep_0": { @@ -2937,7 +2973,8 @@ "fctr_grid_label": { "Desc": - { "parent":"fctr_grid_it", + { + "parent":"fctr_grid_it", "class":"Elm_Label" }, "Properties": @@ -2962,14 +2999,27 @@ }, "Contains": { - "right_panel_box":["right"] + "right_pane_layout":["right"] + } + }, + "right_pane_bg": + { + "Desc": + { + "parent":"right_pane_layout", + "class":"Elm_Bg" + }, + "Properties": + { + "Evas.Object.size_hint_weight":[1, 1], + "Efl.Gfx.Base.visible":[true] } }, "right_panel_box": { "Desc": { - "parent":"right_panes", + "parent":"right_pane_layout", "class":"Elm_Box", "public":true }, @@ -2981,6 +3031,27 @@ }, "Contains":["right_panes_internal"] }, + "right_pane_layout": + { + "Desc": + { + "parent":"right_panes", + "class":"Elm_Layout", + "public":true + }, + "Properties": + { + "Evas.Object.size_hint_weight":[1, 1], + "Evas.Object.size_hint_align":[-1, -1], + "Efl.Gfx.Base.visible":[true], + "Efl.File.file":["panes_layout", "elm/layout/panes/pane"] + }, + "Contains": + { + "right_pane_bg":["erigo.swallow.bg"], + "right_panel_box":["erigo.swallow.content"] + } + }, "right_panes_internal": { "Desc": @@ -3712,4 +3783,4 @@ } } } - } + } \ No newline at end of file --