11#include "../macros.hpp"
15namespace hi {
inline namespace v1 {
25 using callback_token = notifier_type::callback_token;
26 using callback_proto = notifier_type::callback_proto;
44 return _notifier.subscribe(hi_forward(callback), flags);
48 notifier_type _notifier;
70 _value_cbt = this->value.subscribe([&](
auto...) {
78 hi_assert(
not tab_indices.contains(key));
79 tab_indices[key] = index;
84 auto it = tab_indices.
find(*value);
85 if (
it == tab_indices.
end()) {
93 typename decltype(value)::callback_token _value_cbt;
108 using value_type = observer_decay_t<
decltype(value)>;
109 return std::make_shared<default_tab_delegate<value_type>>(hi_forward(value));
std::shared_ptr< tab_delegate > make_default_tab_delegate(auto &&value) noexcept
Create a shared pointer to a default tab delegate.
Definition tab_delegate.hpp:103
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
std::ptrdiff_t ssize_t
Signed size/index into an array.
Definition misc.hpp:33
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
A delegate that controls the state of a tab_widget.
Definition tab_delegate.hpp:22
callback_token subscribe(forward_of< callback_proto > auto &&callback, callback_flags flags=callback_flags::synchronous) noexcept
Subscribe a callback for notifying the widget of a data change.
Definition tab_delegate.hpp:42
A delegate that control the state of a tab_widget.
Definition tab_delegate.hpp:57
default_tab_delegate(forward_of< observer< value_type > > auto &&value) noexcept
Construct a default tab delegate.
Definition tab_delegate.hpp:68
A graphical element that shows only one of a predefined set of mutually exclusive child widgets.
Definition tab_widget.hpp:37
True if T is a forwarded type of Forward.
Definition concepts.hpp:131