12#include "../GFX/paged_image.hpp"
21namespace hi {
inline namespace v1 {
23template<
typename Context>
24concept icon_widget_attribute = forward_of<Context, observer<hi::icon>, observer<hi::alignment>, observer<hi::color>>;
38 observer<icon>
icon = hi::icon{};
42 observer<color>
color = color::foreground();
46 observer<alignment>
alignment = hi::alignment::middle_center();
54 void set_attributes() noexcept {}
55 void set_attributes(icon_widget_attribute
auto&& first, icon_widget_attribute
auto&&...rest)
noexcept
57 if constexpr (forward_of<
decltype(first), observer<hi::icon>>) {
59 }
else if constexpr (forward_of<
decltype(first), observer<hi::alignment>>) {
61 }
else if constexpr (forward_of<
decltype(first), observer<hi::color>>) {
70 [[nodiscard]] box_constraints update_constraints() noexcept override;
71 void set_layout(widget_layout const& context) noexcept override;
72 void draw(draw_context const& context) noexcept override;
75 enum class icon_type { no, glyph, pixmap };
79 paged_image _pixmap_backing;
80 decltype(
icon)::callback_token _icon_cbt;
84 aarectanglei _icon_rectangle;
#define hi_static_no_default(...)
This part of the code should not be reachable, unless a programming bug.
Definition assert.hpp:181
#define hi_forward(x)
Forward a value, based on the decltype of the value.
Definition utility.hpp:29
Functionality for labels, text and icons.
types and utilities for alignment.
geo::extent< float, 2 > extent2
A 2D extent.
Definition extent.hpp:503
DOXYGEN BUG.
Definition algorithm.hpp:15
geometry/margins.hpp
Definition assert.hpp:18
An simple GUI widget that displays an icon.
Definition icon_widget.hpp:32
observer< icon > icon
The icon to be displayed.
Definition icon_widget.hpp:38
observer< alignment > alignment
Alignment of the icon inside the widget.
Definition icon_widget.hpp:46
observer< color > color
The color a non-color icon will be displayed with.
Definition icon_widget.hpp:42
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
Definition icon_widget.hpp:24