diff --git a/src/bin/elementary/test_grid_static.c b/src/bin/elementary/test_grid_static.c index f171cfc0af..55b2c5d9bf 100644 --- a/src/bin/elementary/test_grid_static.c +++ b/src/bin/elementary/test_grid_static.c @@ -41,7 +41,7 @@ set_api_state(api_data *api) break; case GRID_UNPACK: /* 1 */ - elm_grid_unpack(dt->grid, dt->child); + efl_pack_unpack(dt->grid, dt->child); eo_del(dt->child); break; @@ -113,8 +113,18 @@ test_grid_static(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve efl_ui_win_autodel_set(eo_self, EINA_TRUE), eo_event_callback_add(eo_self, EO_EVENT_DEL, _win_del, api)); - gd = eo_add(EFL_UI_GRID_STATIC_CLASS, win, - efl_gfx_size_hint_weight_set(eo_self, 1, 1)); + static int run_count = 0; + if (((run_count++) % 2) == 0) + { + gd = eo_add(EFL_UI_GRID_STATIC_CLASS, win, + efl_gfx_size_hint_weight_set(eo_self, 1, 1)); + } + else + { + gd = eo_add(EFL_UI_GRID_CLASS, win, + efl_gfx_size_hint_weight_set(eo_self, 1, 1), + efl_pack_layout_engine_set(eo_self, EFL_UI_GRID_STATIC_CLASS, NULL)); + } efl_pack(win, gd); api->data.grid = gd; efl_gfx_visible_set(gd, 1); diff --git a/src/lib/elementary/efl_ui_grid_static.c b/src/lib/elementary/efl_ui_grid_static.c index a8209d26b1..08d29fc4fb 100644 --- a/src/lib/elementary/efl_ui_grid_static.c +++ b/src/lib/elementary/efl_ui_grid_static.c @@ -45,6 +45,12 @@ _efl_ui_grid_static_efl_pack_layout_layout_do(Eo_Class *klass EINA_UNUSED, wl = w; hl = h; mirror = elm_widget_mirrored_get(obj); + + if (!gd->req_cols || !gd->req_rows) + { + WRN("Grid.Static size must be set before using! Default to 100x100."); + efl_pack_grid_size_set(obj, 100, 100); + } vwl = gd->req_cols; vhl = gd->req_rows;