36 lines
716 B
C++
36 lines
716 B
C++
#include <psemek/ui/impl/single_container.hpp>
|
|
|
|
namespace psemek::ui::impl
|
|
{
|
|
|
|
util::span<std::unique_ptr<component> const> single_container::children() const
|
|
{
|
|
return {&child_, 1};
|
|
}
|
|
|
|
void single_container::set_child(std::unique_ptr<component> child)
|
|
{
|
|
child_ = std::move(child);
|
|
}
|
|
|
|
void single_container::set_child_token(util::signal<void>::subscription_token token)
|
|
{
|
|
child_token_ = std::move(token);
|
|
}
|
|
|
|
component * single_container::child() const
|
|
{
|
|
return child_.get();
|
|
}
|
|
|
|
std::unique_ptr<component> single_container::release_child()
|
|
{
|
|
return std::move(child_);
|
|
}
|
|
|
|
util::signal<void>::subscription_token single_container::release_child_token()
|
|
{
|
|
return std::move(child_token_);
|
|
}
|
|
|
|
}
|