HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
system_menu_widget.hpp
Go to the documentation of this file.
1// Copyright Take Vos 2020-2022.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
9#pragma once
10
11#include "widget.hpp"
12#include "icon_widget.hpp"
13#include "../label.hpp"
14#include <memory>
15#include <string>
16#include <array>
17
18namespace hi { inline namespace v1 {
19
26class system_menu_widget final : public widget {
27public:
28 using super = widget;
29
30 observer<icon> icon;
31
33
34 system_menu_widget(gui_window& window, widget *parent) noexcept;
35
36 system_menu_widget(gui_window& window, widget *parent, forward_of<observer<hi::icon>> auto&& icon) noexcept :
38 {
39 this->icon = hi_forward(icon);
40 }
41
43 [[nodiscard]] generator<widget *> children() const noexcept override
44 {
45 co_yield _icon_widget.get();
46 }
47
48 widget_constraints const& set_constraints() noexcept override;
49 void set_layout(widget_layout const& layout) noexcept override;
50 void draw(draw_context const& context) noexcept override;
51 [[nodiscard]] hitbox hitbox_test(point3 position) const noexcept override;
53private:
54 aarectangle _icon_rectangle;
56
57 aarectangle _system_menu_rectangle;
58};
59
60}} // namespace hi::v1
#define hi_forward(x)
Forward a value, based on the decltype of the value.
Definition utility.hpp:29
Functionality for labels, text and icons.
Defines widget.
Defines icon_widget.
DOXYGEN BUG.
Definition algorithm.hpp:15
The HikoGUI namespace.
Definition ascii.hpp:19
The system menu widget.
Definition system_menu_widget.hpp:26
An interactive graphical object as part of the user-interface.
Definition widget.hpp:44
widget_layout const & layout() const noexcept
Get the current layout for this widget.
Definition widget.hpp:198
widget *const parent
Pointer to the parent widget.
Definition widget.hpp:53
widget(gui_window &window, widget *parent) noexcept
gui_window & window
Convenient reference to the Window.
Definition widget.hpp:48
The constraints of a widget.
Definition widget_constraints.hpp:26
The layout of a widget.
Definition widget_layout.hpp:37