#include <Widget/Layout/CompoundWidget/DataChannelSelector/DataChannelSelector.hpp>
#include <Widget/Layout/Row/Row.hpp>
#include <Widget/IconToggle/IconToggle.hpp>

DataChannelSelector::DataChannelSelector(DataLink::Channel &selection, std::function<void()> onChanged) : CompoundWidget(
    new Row(
        (new IconToggle(selection, DataLink::Channel::Red, Material::redChannel))->withChangedCallback(onChanged),
        (new IconToggle(selection, DataLink::Channel::Green, Material::greenChannel))->withChangedCallback(onChanged),
        (new IconToggle(selection, DataLink::Channel::Blue, Material::blueChannel))->withChangedCallback(onChanged),
        (new IconToggle(selection, DataLink::Channel::Magenta, Material::magentaChannel))->withChangedCallback(onChanged)
    )
)
{}