aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-07-29 18:20:43 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-08-01 10:29:24 +0900
commit523aea45ced6d4930c384c842a3d9eda28f28cae (patch)
treebaae841cc0a48bb642711fb5fdda3a5e46185db1
parentecore_evas: Register animators for inline image ee (diff)
downloadefl-523aea45ced6d4930c384c842a3d9eda28f28cae.tar.gz
tests: Place inline window inside a box
This shows off how to properly use an inline window. I tried to add extra smarts inside elementary to handle those inline windows like normal objects... but it led to more bugs. The only way that makes sense to use this inline window is to separately treat the image object and the window itself. Any other approach is too tricky. See https://phab.enlightenment.org/T1973
-rw-r--r--src/bin/elementary/test_win_inline.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/bin/elementary/test_win_inline.c b/src/bin/elementary/test_win_inline.c
index b9e08ef739..1c222145c1 100644
--- a/src/bin/elementary/test_win_inline.c
+++ b/src/bin/elementary/test_win_inline.c
@@ -211,7 +211,7 @@ create_handles(Evas_Object *obj)
void
test_win_inline(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- Evas_Object *win, *bg, *win2, *win3;
+ Evas_Object *win, *bg, *win2, *win3, *box;
char buf[PATH_MAX];
win = elm_win_add(NULL, "window-inline", ELM_WIN_BASIC);
@@ -225,16 +225,21 @@ test_win_inline(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *even
elm_win_resize_object_add(win, bg);
evas_object_show(bg);
+ box = eo_add(EFL_UI_BOX_CLASS, win);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ efl_pack(win, box);
+ evas_object_show(box);
+
win2 = elm_win_add(win, "inlined", ELM_WIN_INLINED_IMAGE);
evas_object_event_callback_add(elm_win_inlined_image_object_get(win2), EVAS_CALLBACK_MOUSE_DOWN, cb_mouse_down, NULL);
- fill(win2, EINA_TRUE);
+ fill(win2, EINA_FALSE);
+ elm_win_alpha_set(win2, EINA_TRUE);
+ evas_object_size_hint_weight_set(elm_win_inlined_image_object_get(win2), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(elm_win_inlined_image_object_get(win2), EVAS_HINT_FILL, EVAS_HINT_FILL);
+ efl_gfx_size_hint_margin_set(elm_win_inlined_image_object_get(win2), 20, 20, 20, 20);
+ efl_pack(box, elm_win_inlined_image_object_get(win2));
- evas_object_move(win2, 20, 60);
evas_object_resize(win2, 300, 200);
- // image object for win2 is unlinked to its pos/size - so manual control
- // this allows also for using map and other things with it.
- evas_object_move(elm_win_inlined_image_object_get(win2), 20, 40);
- evas_object_resize(elm_win_inlined_image_object_get(win2), 200, 320);
evas_object_show(win2);
win3 = elm_win_add(win, "inlined", ELM_WIN_INLINED_IMAGE);
@@ -243,6 +248,8 @@ test_win_inline(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *even
fill(win3, EINA_FALSE);
evas_object_resize(win3, 300, 200);
+ // image object for win2 is unlinked to its pos/size - so manual control
+ // this allows also for using map and other things with it.
evas_object_move(elm_win_inlined_image_object_get(win3), 80, 180);
evas_object_resize(elm_win_inlined_image_object_get(win3), 300, 200);
evas_object_show(win3);