8#include "grid_layout_widget.hpp"
22 ttlet lock = std::scoped_lock(gui_system_mutex);
36 if (has_updated_contraints) {
38 _preferred_size = _content->preferred_size();
39 _preferred_base_line = _content->preferred_base_line();
42 return has_updated_contraints;
49 need_layout |= std::exchange(_request_relayout,
false);
53 ttlet window_rectangle_and_margin = expand(_window_rectangle, _margin);
55 _window_rectangle = shrink(new_window_rectangle_and_margin, _margin);
56 _window_clipping_rectangle = _window_rectangle;
59 _content->set_layout_parameters(_window_rectangle, _window_clipping_rectangle);
70 draw_background(context);
79 ttlet lock = std::scoped_lock(gui_system_mutex);
81 auto widget = super::make_widget<WidgetType>(std::forward<Args>(args)...);
90 void draw_background(draw_context context)
noexcept
92 context.clipping_rectangle = expand(context.clipping_rectangle, theme::global->borderWidth);
93 context.draw_box_with_border_outside(
rectangle());
Draw context for drawing using the TTauri shaders.
Definition draw_context.hpp:33
Definition gui_window.hpp:39
f32x4 extent
The current window extent as set by the GPU library.
Definition gui_window.hpp:78
int recurse_lock_count() const noexcept
This function should be used in tt_axiom() to check if the lock is held by current thread.
Definition unfair_recursive_mutex.hpp:60
Definition abstract_container_widget.hpp:11
void update_layout(hires_utc_clock::time_point display_time_point, bool need_layout) noexcept
Update the internal layout of the widget.
Definition abstract_container_widget.hpp:111
void draw(draw_context context, hires_utc_clock::time_point display_time_point) noexcept
Draw the widget.
Definition abstract_container_widget.hpp:125
bool update_constraints(hires_utc_clock::time_point display_time_point, bool need_reconstrain) noexcept
Update the constraints of the widget.
Definition abstract_container_widget.hpp:96
Definition grid_layout_widget.hpp:16
Definition overlay_view_widget.hpp:12
void update_layout(hires_utc_clock::time_point display_time_point, bool need_layout) noexcept override
Update the internal layout of the widget.
Definition overlay_view_widget.hpp:45
bool update_constraints(hires_utc_clock::time_point display_time_point, bool need_reconstrain) noexcept override
Update the constraints of the widget.
Definition overlay_view_widget.hpp:30
void draw(draw_context context, hires_utc_clock::time_point display_time_point) noexcept override
Draw the widget.
Definition overlay_view_widget.hpp:65
float draw_layer() const noexcept
The first drawing layer of the widget.
Definition widget.hpp:149
widget(gui_window &window, std::shared_ptr< abstract_container_widget > parent) noexcept
gui_window & window
Convenient reference to the Window.
Definition widget.hpp:100
abstract_container_widget const & parent() const noexcept
Get a reference to the parent.
virtual aarect window_clipping_rectangle() const noexcept
Get the clipping-rectangle in window coordinates.
Definition widget.hpp:320
aarect rectangle() const noexcept
Get the rectangle in local coordinates.
Definition widget.hpp:340