HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
system_menu_widget.hpp
1// Copyright Take Vos 2020.
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
5#pragma once
6
7#include "widget.hpp"
8#include "icon_widget.hpp"
9#include "../icon.hpp"
10#include <memory>
11#include <string>
12#include <array>
13
14namespace tt {
15
16class system_menu_widget final : public widget {
17public:
18 using super = widget;
19
21
23
25
26 template<typename Icon>
28 {
29 this->icon = std::forward<Icon>(icon);
30 }
31
33 void init() noexcept override;
34 [[nodiscard]] float margin() const noexcept override;
35 [[nodiscard]] bool constrain(hires_utc_clock::time_point display_time_point, bool need_reconstrain) noexcept override;
36 [[nodiscard]] void layout(hires_utc_clock::time_point display_time_point, bool need_layout) noexcept override;
37 [[nodiscard]] hitbox hitbox_test(point2 position) const noexcept override;
39private:
40 icon_widget *_icon_widget = nullptr;
41
42 aarectangle system_menu_rectangle;
43};
44
45} // namespace tt
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:20
Definition gui_window.hpp:36
Definition hitbox.hpp:14
An image, in different formats.
Definition icon.hpp:19
An observable value.
Definition observable.hpp:280
An simple GUI widget that displays an icon.
Definition icon_widget.hpp:26
Definition system_menu_widget.hpp:16
An interactive graphical object as part of the user-interface.
Definition widget.hpp:39
widget *const parent
Pointer to the parent widget.
Definition widget.hpp:48
gui_window & window
Convenient reference to the Window.
Definition widget.hpp:43
widget(gui_window &window, widget *parent) noexcept