8#include "overlay_delegate.hpp"
57 template<
typename Widget,
typename... Args>
60 tt_axiom(is_gui_thread());
61 tt_axiom(not _content);
63 auto &
widget = super::make_widget<Widget>(std::forward<Args>(args)...);
69 void init() noexcept override;
70 void deinit() noexcept override;
71 [[nodiscard]]
bool constrain(
hires_utc_clock::time_point display_time_point,
bool need_reconstrain) noexcept override;
72 [[nodiscard]]
void layout(
hires_utc_clock::time_point display_time_point,
bool need_layout) noexcept override;
74 [[nodiscard]]
color background_color() const noexcept override;
75 [[nodiscard]]
color foreground_color() const noexcept override;
79 std::weak_ptr<delegate_type> _delegate;
80 widget *_content =
nullptr;
This is a RGBA floating point color.
Definition color.hpp:36
Class which represents an rectangle.
Definition rectangle.hpp:16
Draw context for drawing using the TTauri shaders.
Definition draw_context.hpp:29
Definition gui_window.hpp:36
Timestamp.
Definition hires_utc_clock.hpp:19
Definition overlay_delegate.hpp:13
A GUI widget which may exist anywhere on a window overlaid above any other widget.
Definition overlay_widget.hpp:34
Widget & make_widget(Args &&...args) noexcept
Add a content widget directly to this overlay widget.
Definition overlay_widget.hpp:58
overlay_widget(gui_window &window, widget *parent, std::weak_ptr< delegate_type > delegate={}) noexcept
Constructs an empty overlay widget.
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