summaryrefslogtreecommitdiff
path: root/src/bin/elementary/test_win_inline.c
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 /src/bin/elementary/test_win_inline.c
parent58c380823181ea75bc9969dc3dfe017d64b9b508 (diff)
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 T1973
Diffstat (limited to 'src/bin/elementary/test_win_inline.c')
-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 b9e08ef..1c22214 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)
211void 211void
212test_win_inline(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 212test_win_inline(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
213{ 213{
214 Evas_Object *win, *bg, *win2, *win3; 214 Evas_Object *win, *bg, *win2, *win3, *box;
215 char buf[PATH_MAX]; 215 char buf[PATH_MAX];
216 216
217 win = elm_win_add(NULL, "window-inline", ELM_WIN_BASIC); 217 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
225 elm_win_resize_object_add(win, bg); 225 elm_win_resize_object_add(win, bg);
226 evas_object_show(bg); 226 evas_object_show(bg);
227 227
228 box = eo_add(EFL_UI_BOX_CLASS, win);
229 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
230 efl_pack(win, box);
231 evas_object_show(box);
232
228 win2 = elm_win_add(win, "inlined", ELM_WIN_INLINED_IMAGE); 233 win2 = elm_win_add(win, "inlined", ELM_WIN_INLINED_IMAGE);
229 evas_object_event_callback_add(elm_win_inlined_image_object_get(win2), EVAS_CALLBACK_MOUSE_DOWN, cb_mouse_down, NULL); 234 evas_object_event_callback_add(elm_win_inlined_image_object_get(win2), EVAS_CALLBACK_MOUSE_DOWN, cb_mouse_down, NULL);
230 fill(win2, EINA_TRUE); 235 fill(win2, EINA_FALSE);
236 elm_win_alpha_set(win2, EINA_TRUE);
237 evas_object_size_hint_weight_set(elm_win_inlined_image_object_get(win2), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
238 evas_object_size_hint_align_set(elm_win_inlined_image_object_get(win2), EVAS_HINT_FILL, EVAS_HINT_FILL);
239 efl_gfx_size_hint_margin_set(elm_win_inlined_image_object_get(win2), 20, 20, 20, 20);
240 efl_pack(box, elm_win_inlined_image_object_get(win2));
231 241
232 evas_object_move(win2, 20, 60);
233 evas_object_resize(win2, 300, 200); 242 evas_object_resize(win2, 300, 200);
234 // image object for win2 is unlinked to its pos/size - so manual control
235 // this allows also for using map and other things with it.
236 evas_object_move(elm_win_inlined_image_object_get(win2), 20, 40);
237 evas_object_resize(elm_win_inlined_image_object_get(win2), 200, 320);
238 evas_object_show(win2); 243 evas_object_show(win2);
239 244
240 win3 = elm_win_add(win, "inlined", ELM_WIN_INLINED_IMAGE); 245 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
243 fill(win3, EINA_FALSE); 248 fill(win3, EINA_FALSE);
244 249
245 evas_object_resize(win3, 300, 200); 250 evas_object_resize(win3, 300, 200);
251 // image object for win2 is unlinked to its pos/size - so manual control
252 // this allows also for using map and other things with it.
246 evas_object_move(elm_win_inlined_image_object_get(win3), 80, 180); 253 evas_object_move(elm_win_inlined_image_object_get(win3), 80, 180);
247 evas_object_resize(elm_win_inlined_image_object_get(win3), 300, 200); 254 evas_object_resize(elm_win_inlined_image_object_get(win3), 300, 200);
248 evas_object_show(win3); 255 evas_object_show(win3);