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:06:33 +02:00
|
|
|
AlignedLayout(Alignment align, Widget* p = nullptr) noexcept : Layout(p), alignment(align) {}
|
2021-08-06 14:22:56 +02:00
|
|
|
|
|
|
|
[[nodiscard]] auto size() const noexcept -> Size override;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|