summaryrefslogtreecommitdiff
path: root/src/examples/elementary/efl_ui_relative_layout_example_02.c
diff options
context:
space:
mode:
authorYeongjong Lee <yj34.lee@samsung.com>2019-02-22 19:47:47 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2019-02-22 19:47:47 +0900
commit3118bfc34bb97b01a0cdb0caf674aaf3fc20565c (patch)
tree2d922738f5641ed941fe434188c6d16ab7b1b1ff /src/examples/elementary/efl_ui_relative_layout_example_02.c
parent6716feb1080e4b80f974620a72c763ef8e64d22f (diff)
efl_ui_relative_layout: introduce new relative container
Summary: Efl.Ui.Relative_Layout is a container which allows you to position and size with relation to each other. it is possible to position and size using relation like edje even though you don't know a edc script. Position and size can be changed dynamically using widget APIs. @feature ref T5487 Test Plan: make check examples elementary_test -to 'efl.ui.relative_layout' Reviewers: cedric, Hermet, Jaehyun_Cho, zmike, bu5hm4n, jpeg, segfaultxavi Reviewed By: Jaehyun_Cho, segfaultxavi Subscribers: segfaultxavi, kimcinoo Tags: #efl Maniphest Tasks: T5487 Differential Revision: https://phab.enlightenment.org/D7524
Diffstat (limited to '')
-rw-r--r--src/examples/elementary/efl_ui_relative_layout_example_02.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/examples/elementary/efl_ui_relative_layout_example_02.c b/src/examples/elementary/efl_ui_relative_layout_example_02.c
new file mode 100644
index 0000000000..4a8d46a810
--- /dev/null
+++ b/src/examples/elementary/efl_ui_relative_layout_example_02.c
@@ -0,0 +1,45 @@
1// gcc -o efl_ui_relative_layout_example_02 efl_ui_relative_layout_example_02.c `pkg-config --cflags --libs elementary`
2
3#ifdef HAVE_CONFIG_H
4#include "elementary_config.h"
5#else
6#define EFL_BETA_API_SUPPORT 1
7#define EFL_EO_API_SUPPORT 1
8#endif
9
10#include <Elementary.h>
11#include <Efl.h>
12
13EAPI_MAIN int
14elm_main(int argc, char **argv)
15{
16 Eo *win, *layout, *btn1, *btn2;
17
18 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
19 efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
20 efl_text_set(efl_added, "Efl.Ui.Relative_Layout"),
21 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
22
23 layout = efl_add(EFL_UI_RELATIVE_LAYOUT_CLASS, win,
24 efl_content_set(win, efl_added));
25
26 btn1 = efl_add(EFL_UI_BUTTON_CLASS, layout,
27 efl_text_set(efl_added, "btn1"),
28 efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(100, 100)));
29
30 btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout,
31 efl_text_set(efl_added, "btn2"),
32 efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(0, 100)));
33
34 efl_ui_relative_layout_relation_right_set(layout, btn1, btn2, 0.0);
35 efl_ui_relative_layout_relation_bottom_set(layout, btn1, btn2, 0.0);
36
37 efl_ui_relative_layout_relation_left_set(layout, btn2, btn1, 1.0);
38 efl_ui_relative_layout_relation_top_set(layout, btn2, btn1, 1.0);
39
40 efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 300));
41
42 elm_run();
43 return 0;
44}
45ELM_MAIN()