81 template<
typename Label,
typename Alignment = hi::alignment,
typename TextStyle = hi::theme_text_style>
86 Alignment &&
alignment = hi::alignment::middle_right(),
87 TextStyle &&
text_style = theme_text_style::label) noexcept :
90 this->label = std::forward<Label>(
label);
91 this->alignment = std::forward<Alignment>(
alignment);
92 this->text_style = std::forward<TextStyle>(
text_style);
98 co_yield _icon_widget.get();
99 co_yield _text_widget.get();
102 widget_constraints
const &set_constraints() noexcept override;
103 void set_layout(widget_layout const &layout) noexcept override;
104 void draw(draw_context const &context) noexcept;
105 [[nodiscard]] hitbox hitbox_test(point3 position) const noexcept;
111 decltype(label)::token_type _label_cbt;
112 decltype(text_style)::token_type _text_style_cbt;
114 aarectangle _icon_rectangle;
115 std::unique_ptr<icon_widget> _icon_widget;
116 aarectangle _text_rectangle;
117 std::unique_ptr<text_widget> _text_widget;
119 label_widget(gui_window &window, widget *parent) noexcept;
label_widget(gui_window &window, widget *parent, Label &&label, Alignment &&alignment=hi::alignment::middle_right(), TextStyle &&text_style=theme_text_style::label) noexcept
Construct a label widget.
Definition label_widget.hpp:82