4hi_export_module(hikogui.theme.theme_variable);
6hi_export
namespace hi {
inline namespace v1 {
10template<
typename T, fixed_
string Tag>
14 constexpr static auto tag = Tag;
21 static void set(theme_selector
const& needle, value_type
const &value)
noexcept
23 for (
auto *ptr : _values) {
24 if (match(needle, ptr->_selector)) {
38 hi_axiom(it != _values.end());
45 hi_axiom(it == _values.end() or *it !=
this);
46 _values.insert(it,
this);
49 [[nodiscard]] value_type
const& operator*() const noexcept
54 template<
typename... Args>
55 [[nodiscard]]
decltype(
auto)
operator()(Args
const&... args)
const noexcept
60 template<
typename Arg>
61 [[nodiscard]]
decltype(
auto)
operator[](Arg
const& arg)
const noexcept
67 theme_selector _selector;
74using margin_left = theme_variable<
"margin-left", theme_length>;
75using margin_right = theme_variable<
"margin-right", theme_length>;
76using margin_top = theme_variable<
"margin-top", theme_length>;
77using margin_bottom = theme_variable<
"margin-bottom", theme_length>;
78using margin = theme_variable<
"margin", theme_length_quad>;
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
Definition theme_value.hpp:11
static void set(theme_selector const &needle, value_type const &value) noexcept
Set the value for all variables matching a selector.
Definition theme_value.hpp:21
This selector allows access to member variable by name.
Definition type_traits.hpp:691