aboutsummaryrefslogtreecommitdiffstats
path: root/reference
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-12-13 12:53:30 +0000
committerAndy Williams <andy@andywilliams.me>2017-12-13 12:53:30 +0000
commitfdad34a4293aabf34d31515d787c348791022ec4 (patch)
tree82d64a54e05a6e31950172b1890ac6f51620d5a5 /reference
parentui: Fix close callbacks for the UI reference examples (diff)
downloadexamples-fdad34a4293aabf34d31515d787c348791022ec4.tar.gz
ui: Add panes to the ui reference now they are working
Diffstat (limited to 'reference')
-rw-r--r--reference/c/ui/src/ui_container.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/reference/c/ui/src/ui_container.c b/reference/c/ui/src/ui_container.c
index 2dd3b0c5..17e53327 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));
}