22namespace hi {
inline namespace v1 {
24template<
typename Context>
26 forward_of<Context, observer<hi::label>, observer<hi::alignment>, observer<hi::semantic_text_style>>;
67 observer<alignment>
alignment = hi::alignment::top_right();
71 observer<semantic_text_style>
text_style = semantic_text_style::label;
87 [[nodiscard]] generator<widget *> children() const noexcept
override
89 co_yield _icon_widget.get();
90 co_yield _text_widget.get();
94 void set_layout(
widget_layout const& context)
noexcept override;
95 void draw(draw_context
const& context)
noexcept;
96 [[nodiscard]] hitbox hitbox_test(point3 position)
const noexcept;
102 decltype(
label)::callback_token _label_cbt;
103 decltype(
text_style)::callback_token _text_style_cbt;
105 aarectangle _icon_rectangle;
108 aarectangle _text_rectangle;
112 void set_attributes() noexcept {}
113 void set_attributes(label_widget_attribute
auto&& first, label_widget_attribute
auto&&...rest)
noexcept
115 if constexpr (forward_of<
decltype(first), observer<hi::label>>) {
117 }
else if constexpr (forward_of<
decltype(first), observer<hi::alignment>>) {
119 }
else if constexpr (forward_of<
decltype(first), observer<hi::semantic_text_style>>) {
#define hi_static_no_default()
This part of the code should not be reachable, unless a programming bug.
Definition assert.hpp:172
#define hi_forward(x)
Forward a value, based on the decltype of the value.
Definition utility.hpp:29
Functionality for labels, text and icons.
DOXYGEN BUG.
Definition algorithm.hpp:15
The HikoGUI namespace.
Definition ascii.hpp:19
The GUI widget displays and lays out text together with an icon.
Definition label_widget.hpp:41
observer< label > label
The label to display.
Definition label_widget.hpp:47
observer< alignment > alignment
How the label and icon are aligned.
Definition label_widget.hpp:67
observer< semantic_text_style > text_style
The text style to display the label's text in and color of the label's (non-color) icon.
Definition label_widget.hpp:71
label_widget(widget *parent, label_widget_attribute auto &&...attributes) noexcept
Construct a label widget.
Definition label_widget.hpp:80
Definition set_constraints_context.hpp:15
An interactive graphical object as part of the user-interface.
Definition widget.hpp:45
widget(widget *parent) noexcept
widget * parent
Pointer to the parent widget.
Definition widget.hpp:50
The constraints of a widget.
Definition widget_constraints.hpp:26
The layout of a widget.
Definition widget_layout.hpp:40
Definition label_widget.hpp:25