@@ -208,9 +208,8 @@ utki::shared_ref<container> make_caption(
208
208
209
209
utki::shared_ref<container> make_middle (
210
210
utki::shared_ref<context> c, //
211
- container::parameters container_params,
212
- string title,
213
- widget_list children
211
+ utki::shared_ref<container> content_conatiner,
212
+ string title
214
213
)
215
214
{
216
215
// clang-format off
@@ -228,30 +227,16 @@ utki::shared_ref<container> make_middle(
228
227
make_caption (c,
229
228
std::move (title)
230
229
),
231
- m::container (c,
232
- {
233
- .layout_params = {
234
- .dims = {ruis::dim::fill, ruis::dim::fill},
235
- .weight = 1
236
- },
237
- .widget_params = {
238
- .id = " ruis_content" s,
239
- .clip = true
240
- },
241
- .container_params = std::move (container_params)
242
- },
243
- std::move (children)
244
- )
230
+ std::move (content_conatiner)
245
231
}
246
232
);
247
233
// clang-format on
248
234
}
249
235
250
236
utki::shared_ref<container> make_middle_row (
251
237
utki::shared_ref<context> c, //
252
- container::parameters container_params,
253
- string title,
254
- widget_list children
238
+ utki::shared_ref<container> content_container,
239
+ string title
255
240
)
256
241
{
257
242
// clang-format off
@@ -277,9 +262,8 @@ utki::shared_ref<container> make_middle_row(
277
262
}
278
263
),
279
264
make_middle (c,
280
- std::move (container_params),
281
- std::move (title),
282
- std::move (children)
265
+ std::move (content_container),
266
+ std::move (title)
283
267
),
284
268
m::mouse_proxy (c,
285
269
{
@@ -298,9 +282,8 @@ utki::shared_ref<container> make_middle_row(
298
282
299
283
std::vector<utki::shared_ref<widget>> make_children (
300
284
utki::shared_ref<context> c, //
301
- container::parameters container_params,
302
- string title,
303
- widget_list children
285
+ utki::shared_ref<container> content_container,
286
+ string title
304
287
)
305
288
{
306
289
// clang-format off
@@ -317,9 +300,8 @@ std::vector<utki::shared_ref<widget>> make_children(
317
300
{
318
301
make_top_row (c),
319
302
make_middle_row (c,
320
- std::move (container_params),
321
- std::move (title),
322
- std::move (children)
303
+ std::move (content_container),
304
+ std::move (title)
323
305
),
324
306
make_bottom_row (c)
325
307
}
@@ -351,6 +333,23 @@ window::window(
351
333
std::move(params.layout_params),
352
334
std::move(params.widget_params)
353
335
),
336
+ content_wrapping(
337
+ m::container (this ->context,
338
+ // clang-format off
339
+ {
340
+ .layout_params = {
341
+ .dims = {ruis::dim::fill, ruis::dim::fill},
342
+ .weight = 1
343
+ },
344
+ .widget_params = {
345
+ .clip = true
346
+ },
347
+ .container_params = std::move (params.container_params )
348
+ },
349
+ // clang-format on
350
+ std::move (children)
351
+ )
352
+ ),
354
353
// clang-format off
355
354
container( //
356
355
this ->context,
@@ -361,9 +360,8 @@ window::window(
361
360
},
362
361
make_children (
363
362
this ->context, //
364
- std::move (params.container_params),
365
- std::move(params.title),
366
- std::move(children)
363
+ this ->content_container,
364
+ std::move (params.title)
367
365
)
368
366
)
369
367
// clang-format on
@@ -414,9 +412,6 @@ window::window(
414
412
void ruis::window::setup_widgets ()
415
413
{
416
414
// TODO: refactor to avoid widget lookup by id.
417
- this ->content_area = this ->try_get_widget_as <container>(" ruis_content" );
418
- ASSERT (this ->content_area )
419
-
420
415
this ->title = this ->try_get_widget_as <text>(" ruis_title" );
421
416
ASSERT (this ->title )
422
417
0 commit comments