ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/tools/examples.git/commit/?id=fdad34a4293aabf34d31515d787c348791022ec4

commit fdad34a4293aabf34d31515d787c348791022ec4
Author: Andy Williams <[email protected]>
Date:   Wed Dec 13 12:53:30 2017 +0000

    ui: Add panes to the ui reference now they are working
---
 reference/c/ui/src/ui_container.c | 28 +++++++++-------------------
 1 file changed, 9 insertions(+), 19 deletions(-)

diff --git a/reference/c/ui/src/ui_container.c 
b/reference/c/ui/src/ui_container.c
index 2dd3b0c..17e5332 100644
--- a/reference/c/ui/src/ui_container.c
+++ b/reference/c/ui/src/ui_container.c
@@ -16,7 +16,6 @@
  * TODO Layout
  * TODO - still ELM Conformant
  * TODO - still ELM Mapbuf
- * TODO - still ELM Naviframe
  * TODO - still ELM Scroller
  * TODO - still ELM Table
  */
@@ -56,20 +55,14 @@ _ui_grid_setup(Efl_Ui_Win *win)
 
 // Load some boxes - a horizontal one for the window layout and a vertical
 // one to contain a flow
-static void
+static Efl_Ui_Box *
 _ui_boxes_setup(Efl_Ui_Win *win)
 {
-   Efl_Ui_Box *hbox, *box, *button;
+   Efl_Ui_Box *box, *button;
    int i;
 
-   hbox = efl_add(EFL_UI_BOX_CLASS, win,
-                 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
-                 efl_pack_padding_set(efl_added, 5, 0, EINA_TRUE),
-                 efl_content_set(win, efl_added));
-
    box = efl_add(EFL_UI_BOX_CLASS, win,
-                 efl_pack(hbox, efl_added));
-   efl_pack(hbox, _ui_grid_setup(win));
+                 efl_pack_padding_set(efl_added, 5, 0, EINA_TRUE));
 
    for (i = 1; i <= 4; i++)
      {
@@ -81,10 +74,10 @@ _ui_boxes_setup(Efl_Ui_Win *win)
           efl_gfx_size_hint_max_set(button, EINA_SIZE2D(100, 50));
      }
 
+    return box;
 }
 
 // Load a vertical and horizontal split into the window
-// TODO re-enable this when it actually works in EFL
 static void
 _ui_panes_setup(Efl_Ui_Win *win)
 {
@@ -93,19 +86,17 @@ _ui_panes_setup(Efl_Ui_Win *win)
    split = efl_add(EFL_UI_PANES_CLASS, win,
                    efl_content_set(win, efl_added),
                    efl_ui_panes_split_ratio_set(efl_added,  0.75));
-
-   efl_add(EFL_UI_BOX_CLASS, win,
-           efl_content_set(efl_part(split, "first"), efl_added));
+   efl_content_set(efl_part(split, "first"), _ui_boxes_setup(win));
 
    horiz_split = efl_add(EFL_UI_PANES_CLASS, win,
                          efl_content_set(efl_part(split, "second"), efl_added),
+                         efl_ui_direction_set(efl_added, 
EFL_UI_DIR_HORIZONTAL),
                          efl_ui_panes_split_ratio_set(efl_added,  0.85));
-
-   efl_add(EFL_UI_BOX_CLASS, win,
-           efl_content_set(efl_part(horiz_split, "first"), efl_added));
+   efl_content_set(efl_part(horiz_split, "first"), _ui_grid_setup(win));
 
    efl_add(EFL_UI_BUTTON_CLASS, win,
            efl_text_set(efl_added, "Quit"),
+           efl_gfx_size_hint_max_set(efl_added, EINA_SIZE2D(150, 30)),
            efl_content_set(efl_part(horiz_split, "second"), efl_added),
            efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
                                   _gui_quit_cb, efl_added));
@@ -121,11 +112,10 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev 
EINA_UNUSED)
                  efl_text_set(efl_added, "Hello World"),
                  efl_ui_win_autodel_set(efl_added, EINA_TRUE));
 
-//   _ui_panes_setup(win);
-   _ui_boxes_setup(win);
    // when the user clicks "close" on a window there is a request to delete
    efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _gui_quit_cb, 
NULL);
 
+   _ui_panes_setup(win);
 
    efl_gfx_size_set(win, EINA_SIZE2D(350, 250));
 }

-- 


Reply via email to