18namespace hi {
inline namespace v1 {
31 observer<label> title;
33 window_widget(forward_of<observer<label>>
auto&& title) noexcept :
36 _toolbar = std::make_unique<toolbar_widget>(
this);
38 if (operating_system::current == operating_system::windows) {
39#if HI_OPERATING_SYSTEM == HI_OS_WINDOWS
41 this->_system_menu->icon = this->title.get<
"icon">();
44 }
else if (operating_system::current == operating_system::macos) {
50 _content = std::make_unique<grid_widget>(
this);
72 [[nodiscard]] generator<
widget_intf&> children(
bool include_invisible) noexcept override;
74 void set_layout(
widget_layout const& context) noexcept override;
75 void draw(
draw_context const& context) noexcept override;
76 [[nodiscard]] hitbox hitbox_test(point2 position) const noexcept override;
77 bool handle_event(
gui_event const& event) noexcept override;
78 bool process_event(
gui_event const& event) const noexcept override;
79 void set_window(gui_window *window) noexcept override;
80 [[nodiscard]] gui_window *window() const noexcept override;
83 gui_window *_window =
nullptr;
93 mutable
bool _can_resize_width;
94 mutable
bool _can_resize_height;
96#if HI_OPERATING_SYSTEM == HI_OS_WINDOWS
Functionality for labels, text and icons.
Defines window_traffic_lights_widget.
Defines system_menu_widget.
#define hi_no_default(...)
This part of the code should not be reachable, unless a programming bug.
Definition assert.hpp:279
#define hi_forward(x)
Forward a value, based on the decltype of the value.
Definition utility.hpp:29
@ right
Align the text to the right side.
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
This is a RGBA floating point color.
Definition color.hpp:42
Draw context for drawing using the HikoGUI shaders.
Definition draw_context.hpp:209
A user interface event.
Definition gui_event.hpp:74
Definition widget_intf.hpp:16
The layout of a widget.
Definition widget_layout.hpp:35
2D constraints.
Definition box_constraints.hpp:22
Definition box_shape.hpp:15
A GUI widget that lays out child-widgets in a grid with variable sized cells.
Definition grid_widget.hpp:39
The system menu widget.
Definition system_menu_widget.hpp:26
A toolbar widget is located at the top of a window and lays out its children horizontally.
Definition toolbar_widget.hpp:34
An interactive graphical object as part of the user-interface.
Definition widget.hpp:36
widget(widget *parent) noexcept
Window control button widget.
Definition window_traffic_lights_widget.hpp:26
The top-level window widget.
Definition window_widget.hpp:27
grid_widget & content() noexcept
Get a reference to the window's content widget.
toolbar_widget & toolbar() noexcept
Get a reference to window's toolbar widget.
color background_color() noexcept
The background color of the window.