#include namespace psemek::ui { element::children_range toggle_button::children() const { return children_range{children_}; } toggle_button::~toggle_button() { release_children(); } void toggle_button::set_label(std::shared_ptr label) { if (icon()) set_icon(nullptr); if (label_) label_->set_parent(nullptr); label_ = std::move(label); children_[0] = label_.get(); if (label_) label_->set_parent(this); } void toggle_button::set_icon(std::shared_ptr icon) { if (label()) set_label(nullptr); if (icon_) icon_->set_parent(nullptr); icon_ = std::move(icon); children_[0] = icon_.get(); if (icon_) { icon_->set_parent(this); icon_->set_downscale(false); } } }