13#include "../l10n/l10n.hpp"
14#include "../macros.hpp"
20hi_export_module(hikogui.widgets.system_menu_widget);
22hi_export
namespace hi {
inline namespace v1 {
40 _icon_widget = std::make_unique<icon_widget>(
this, icon);
43 template<forward_of<observer<hi::icon>> Icon>
47 this->icon = std::forward<Icon>(icon);
53 co_yield *_icon_widget;
58 hi_assert_not_null(_icon_widget);
61 _icon_constraints = _icon_widget->update_constraints();
63 auto const size =
extent2{theme().large_size(), theme().large_size()};
64 return {size, size, size};
76 theme().margin<
float>(),
78 context.width() - theme().margin<
float>(),
79 context.height() - theme().margin<
float>()};
82 _icon_widget->set_layout(
context.transform(_icon_shape));
92 [[
nodiscard]] hitbox hitbox_test(point2 position)
const noexcept override
94 hi_axiom(loop::main().on_thread());
99 return {
id, _layout.elevation, hitbox_type::application_icon};
@ partial
A widget is partially enabled.
@ invisible
The widget is invisible.
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
The HikoGUI namespace.
Definition recursive_iterator.hpp:15
bool compare_store(T &lhs, U &&rhs) noexcept
Compare then store if there was a change.
Definition misc.hpp:53
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:378
Class which represents an axis-aligned rectangle.
Definition aarectangle.hpp:33
A high-level geometric extent.
Definition extent2.hpp:32
Draw context for drawing using the HikoGUI shaders.
Definition draw_context_intf.hpp:209
widget_id id
The numeric identifier of a widget.
Definition widget_intf.hpp:30
widget_layout const & layout() const noexcept
Get the current layout for this widget.
Definition widget_intf.hpp:206
widget_intf * parent
Pointer to the parent widget.
Definition widget_intf.hpp:35
The layout of a widget.
Definition widget_layout.hpp:56
2D constraints.
Definition box_constraints.hpp:25
Definition box_shape.hpp:18
A observer pointing to the whole or part of a observed_base.
Definition observer_intf.hpp:32
Definition not_null.hpp:22
The system menu widget.
Definition system_menu_widget.hpp:30
An interactive graphical object as part of the user-interface.
Definition widget.hpp:37
widget(widget_intf const *parent) noexcept
Definition widget.hpp:49