14#include "../geometry/module.hpp"
15#include "../layout/grid_layout.hpp"
23namespace hi {
inline namespace v1 {
25template<
typename Context>
27 forward_of<Context, observer<hi::label>, observer<hi::alignment>, observer<hi::semantic_text_style>>;
67 observer<alignment>
alignment = hi::alignment::top_flush();
71 observer<semantic_text_style>
text_style = semantic_text_style::label;
86 [[nodiscard]] generator<widget const &> children(
bool include_invisible)
const noexcept override
88 co_yield *_icon_widget;
89 co_yield *_text_widget;
93 void set_layout(
widget_layout const& context) noexcept override;
94 void draw(
draw_context const& context) noexcept override;
95 [[nodiscard]] hitbox hitbox_test(point2i position) const noexcept override;
101 decltype(
label)::callback_token _label_cbt;
102 decltype(
text_style)::callback_token _text_style_cbt;
103 decltype(
alignment)::callback_token _alignment_cbt;
109 void set_attributes() noexcept {}
110 void set_attributes(label_widget_attribute
auto&& first, label_widget_attribute
auto&&...rest)
noexcept
112 if constexpr (forward_of<
decltype(first), observer<hi::label>>) {
114 }
else if constexpr (forward_of<
decltype(first), observer<hi::alignment>>) {
116 }
else if constexpr (forward_of<
decltype(first), observer<hi::semantic_text_style>>) {
Functionality for labels, text and icons.
#define hi_static_no_default(...)
This part of the code should not be reachable, unless a programming bug.
Definition assert.hpp:308
#define hi_forward(x)
Forward a value, based on the decltype of the value.
Definition utility.hpp:29
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
Draw context for drawing using the HikoGUI shaders.
Definition draw_context.hpp:211
2D constraints.
Definition box_constraints.hpp:22
Grid layout algorithm.
Definition grid_layout.hpp:934
An simple GUI widget that displays an icon.
Definition icon_widget.hpp:32
The GUI widget displays and lays out text together with an icon.
Definition label_widget.hpp:42
observer< label > label
The label to display.
Definition label_widget.hpp:48
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
A text widget.
Definition text_widget.hpp:61
An interactive graphical object as part of the user-interface.
Definition widget.hpp:46
widget(widget *parent) noexcept
widget * parent
Pointer to the parent widget.
Definition widget.hpp:51
The layout of a widget.
Definition widget_layout.hpp:38
Definition label_widget.hpp:26