bwidgets/inc/basic_widgets/w/aligned_layout.hpp

35 lines
852 B
C++
Raw Normal View History

2021-08-06 14:22:56 +02:00
#ifndef BWIDGETS_ALIGNED_LAYOUT_HPP
#define BWIDGETS_ALIGNED_LAYOUT_HPP
#include <basic_widgets/w/base/layout.hpp>
namespace bwidgets
{
class AlignedLayout final : public Layout
{
private:
2021-08-08 16:00:22 +02:00
void _update_layout(const SDL_Rect&) override;
2021-08-06 14:22:56 +02:00
public:
enum struct Alignment
{
HORIZONTAL,
VERTICAL
} alignment;
2021-08-12 16:10:49 +02:00
AlignedLayout(Alignment align, Widget* p = nullptr) noexcept
: Layout(p), alignment(align)
{}
2021-08-06 14:22:56 +02:00
AlignedLayout(const AlignedLayout&) = delete;
2021-08-14 09:25:28 +02:00
AlignedLayout(AlignedLayout&&) = delete;
~AlignedLayout() override = default;
auto operator=(const AlignedLayout&) = delete;
auto operator=(AlignedLayout&&) = delete;
2021-08-06 14:22:56 +02:00
[[nodiscard]] auto size() const noexcept -> Size override;
};
}
#endif