1 #ifndef TERMOX_WIDGET_LAYOUTS_VERTICAL_HPP
2 #define TERMOX_WIDGET_LAYOUTS_VERTICAL_HPP
8 #include <termox/widget/layouts/detail/linear_layout.hpp>
10 namespace ox::layout::v_detail {
13 [[nodiscard]]
auto operator()(
int primary,
int secondary)
const -> Area
15 return {secondary, primary};
20 [[nodiscard]]
auto operator()(
int primary,
int secondary)
const -> Point
22 return {secondary, primary};
34 [[nodiscard]]
auto operator()(
Widget const& w)
const ->
int
36 return w.
area().height;
41 [[nodiscard]]
auto operator()(
Widget const& w)
const ->
int
55 [[nodiscard]]
auto operator()(
Widget const& w)
const ->
int
57 return w.
area().width;
62 [[nodiscard]]
auto operator()(
Widget const& w)
const ->
int
69 Dimension_parameters<Primary_policy, Primary_length, Primary_offset>;
72 Dimension_parameters<Secondary_policy, Secondary_length, Secondary_offset>;
79 namespace ox::layout {
81 template <
typename Child_t = W
idget>
85 template <
typename Widget_t =
Widget,
typename... Args>
86 [[nodiscard]]
auto vertical(Args&&... args)
87 -> std::unique_ptr<Vertical<Widget_t>>
89 return std::make_unique<Vertical<Widget_t>>(std::forward<Args>(args)...);
93 template <
typename Child_t>
96 auto is_vertical_impl(...) -> std::false_type;
100 using Is_vertical = decltype(detail::is_vertical_impl(std::declval<T&>()));
103 template <
typename T>
104 inline bool constexpr is_vertical_v = Is_vertical<T>::value;
Defines how a Layout should resize a Widget in one length Dimension.
Definition: size_policy.hpp:11
Lays out Widgets in 2D, sharing space in a primary dimension.
Definition: linear_layout.hpp:35
Definition: linear_layout.hpp:15
Definition: linear_layout.hpp:25
Definition: vertical.hpp:12
Definition: vertical.hpp:19
Definition: vertical.hpp:33
Definition: vertical.hpp:40
Definition: vertical.hpp:26
Definition: vertical.hpp:54
Definition: vertical.hpp:61
Definition: vertical.hpp:47