237 if constexpr (std::is_base_of_v<i_widget, Type>)
239 if constexpr (std::is_constructible_v<Type, i_element&>)
240 iLayoutItem = make_ref<Type>(*
this);
241 else if constexpr (std::is_constructible_v<Type, i_widget&, window_style>)
243 else if constexpr (std::is_constructible_v<Type, i_element&, i_widget&, window_style>)
245 else if constexpr (std::is_constructible_v<Type, i_widget&, neolib::i_string const&, window_style>)
247 else if constexpr (std::is_constructible_v<Type, i_element&, i_widget&, neolib::i_string const&, window_style>)
249 else if constexpr (std::is_constructible_v<Type, i_widget&, neolib::i_string const&>)
251 else if constexpr (std::is_constructible_v<Type, i_element&, i_widget&, neolib::i_string const&>)
252 iLayoutItem = make_ref<Type>(*
this, aParent, iId.
to_std_string());
253 else if constexpr (std::is_constructible_v<Type, window_style>)
255 else if constexpr (std::is_constructible_v<Type, i_element&, window_style>)
257 else if constexpr (std::is_constructible_v<Type, neolib::i_string const&, window_style>)
259 else if constexpr (std::is_constructible_v<Type, i_widget&, neolib::i_string const&, window_style>)
261 else if constexpr (std::is_constructible_v<Type, neolib::i_string const&>)
263 else if constexpr (std::is_constructible_v<Type, i_element&, neolib::i_string const&>)
265 else if constexpr (std::is_default_constructible_v<Type>)
266 iLayoutItem = make_ref<Type>();
271 if (std::is_same_v<Type, progress_bar>)
273 auto& progressBar =
static_cast<progress_bar&
>(iLayoutItem->as_widget());
275 progressBar.set_minimum(0.0);
276 progressBar.set_maximum(1.0);
278 if (iLayoutItem->is_widget() && iLayoutItem->as_widget().is_root() && iLayoutItem->as_widget().root().is_nested())
279 service<i_surface_manager>().nest_for(aParent,
nest_type::Caddy).add(iLayoutItem->as_widget().root().native_window());
281 else if constexpr (std::is_base_of_v<i_layout, Type>)
283 if constexpr (std::is_constructible_v<Type, i_element&>)
284 iLayoutItem = make_ref<Type>(*
this);
286 iLayoutItem = make_ref<Type>();