77 template<
typename Label,
typename Alignment = hi::alignment,
typename TextStyle = hi::semantic_text_style>
82 Alignment &&
alignment = hi::alignment::top_right(),
83 TextStyle &&
text_style = semantic_text_style::label) noexcept :
86 this->label = std::forward<Label>(
label);
87 this->alignment = std::forward<Alignment>(
alignment);
88 this->text_style = std::forward<TextStyle>(
text_style);
94 co_yield _icon_widget.get();
95 co_yield _text_widget.get();
98 widget_constraints
const &set_constraints() noexcept override;
99 void set_layout(widget_layout const &layout) noexcept override;
100 void draw(draw_context const &context) noexcept;
101 [[nodiscard]] hitbox hitbox_test(point3 position) const noexcept;
107 decltype(label)::token_type _label_cbt;
108 decltype(text_style)::token_type _text_style_cbt;
110 aarectangle _icon_rectangle;
111 widget_constraints _icon_constraints;
112 std::unique_ptr<icon_widget> _icon_widget;
113 aarectangle _text_rectangle;
114 widget_constraints _text_constraints;
115 std::unique_ptr<text_widget> _text_widget;
117 label_widget(gui_window &window, widget *parent) noexcept;
label_widget(gui_window &window, widget *parent, Label &&label, Alignment &&alignment=hi::alignment::top_right(), TextStyle &&text_style=semantic_text_style::label) noexcept
Construct a label widget.
Definition label_widget.hpp:78