summaryrefslogtreecommitdiff
path: root/reference/c/ui/src/ui_container.c
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/c/ui/src/ui_container.c
parenteabdff1f2731c680f08e31b3a07d06ecc0d23036 (diff)
ui: Add panes to the ui reference now they are working
Diffstat (limited to 'reference/c/ui/src/ui_container.c')
-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 @@
16 * TODO Layout 16 * TODO Layout
17 * TODO - still ELM Conformant 17 * TODO - still ELM Conformant
18 * TODO - still ELM Mapbuf 18 * TODO - still ELM Mapbuf
19 * TODO - still ELM Naviframe
20 * TODO - still ELM Scroller 19 * TODO - still ELM Scroller
21 * TODO - still ELM Table 20 * TODO - still ELM Table
22 */ 21 */
@@ -56,20 +55,14 @@ _ui_grid_setup(Efl_Ui_Win *win)
56 55
57// Load some boxes - a horizontal one for the window layout and a vertical 56// Load some boxes - a horizontal one for the window layout and a vertical
58// one to contain a flow 57// one to contain a flow
59static void 58static Efl_Ui_Box *
60_ui_boxes_setup(Efl_Ui_Win *win) 59_ui_boxes_setup(Efl_Ui_Win *win)
61{ 60{
62 Efl_Ui_Box *hbox, *box, *button; 61 Efl_Ui_Box *box, *button;
63 int i; 62 int i;
64 63
65 hbox = efl_add(EFL_UI_BOX_CLASS, win,
66 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
67 efl_pack_padding_set(efl_added, 5, 0, EINA_TRUE),
68 efl_content_set(win, efl_added));
69
70 box = efl_add(EFL_UI_BOX_CLASS, win, 64 box = efl_add(EFL_UI_BOX_CLASS, win,
71 efl_pack(hbox, efl_added)); 65 efl_pack_padding_set(efl_added, 5, 0, EINA_TRUE));
72 efl_pack(hbox, _ui_grid_setup(win));
73 66
74 for (i = 1; i <= 4; i++) 67 for (i = 1; i <= 4; i++)
75 { 68 {
@@ -81,10 +74,10 @@ _ui_boxes_setup(Efl_Ui_Win *win)
81 efl_gfx_size_hint_max_set(button, EINA_SIZE2D(100, 50)); 74 efl_gfx_size_hint_max_set(button, EINA_SIZE2D(100, 50));
82 } 75 }
83 76
77 return box;
84} 78}
85 79
86// Load a vertical and horizontal split into the window 80// Load a vertical and horizontal split into the window
87// TODO re-enable this when it actually works in EFL
88static void 81static void
89_ui_panes_setup(Efl_Ui_Win *win) 82_ui_panes_setup(Efl_Ui_Win *win)
90{ 83{
@@ -93,19 +86,17 @@ _ui_panes_setup(Efl_Ui_Win *win)
93 split = efl_add(EFL_UI_PANES_CLASS, win, 86 split = efl_add(EFL_UI_PANES_CLASS, win,
94 efl_content_set(win, efl_added), 87 efl_content_set(win, efl_added),
95 efl_ui_panes_split_ratio_set(efl_added, 0.75)); 88 efl_ui_panes_split_ratio_set(efl_added, 0.75));
96 89 efl_content_set(efl_part(split, "first"), _ui_boxes_setup(win));
97 efl_add(EFL_UI_BOX_CLASS, win,
98 efl_content_set(efl_part(split, "first"), efl_added));
99 90
100 horiz_split = efl_add(EFL_UI_PANES_CLASS, win, 91 horiz_split = efl_add(EFL_UI_PANES_CLASS, win,
101 efl_content_set(efl_part(split, "second"), efl_added), 92 efl_content_set(efl_part(split, "second"), efl_added),
93 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
102 efl_ui_panes_split_ratio_set(efl_added, 0.85)); 94 efl_ui_panes_split_ratio_set(efl_added, 0.85));
103 95 efl_content_set(efl_part(horiz_split, "first"), _ui_grid_setup(win));
104 efl_add(EFL_UI_BOX_CLASS, win,
105 efl_content_set(efl_part(horiz_split, "first"), efl_added));
106 96
107 efl_add(EFL_UI_BUTTON_CLASS, win, 97 efl_add(EFL_UI_BUTTON_CLASS, win,
108 efl_text_set(efl_added, "Quit"), 98 efl_text_set(efl_added, "Quit"),
99 efl_gfx_size_hint_max_set(efl_added, EINA_SIZE2D(150, 30)),
109 efl_content_set(efl_part(horiz_split, "second"), efl_added), 100 efl_content_set(efl_part(horiz_split, "second"), efl_added),
110 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, 101 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
111 _gui_quit_cb, efl_added)); 102 _gui_quit_cb, efl_added));
@@ -121,11 +112,10 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
121 efl_text_set(efl_added, "Hello World"), 112 efl_text_set(efl_added, "Hello World"),
122 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 113 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
123 114
124// _ui_panes_setup(win);
125 _ui_boxes_setup(win);
126 // when the user clicks "close" on a window there is a request to delete 115 // when the user clicks "close" on a window there is a request to delete
127 efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _gui_quit_cb, NULL); 116 efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _gui_quit_cb, NULL);
128 117
118 _ui_panes_setup(win);
129 119
130 efl_gfx_size_set(win, EINA_SIZE2D(350, 250)); 120 efl_gfx_size_set(win, EINA_SIZE2D(350, 250));
131} 121}