bwidgets/inc/basic_widgets/w/aligned_layout.hpp

27 lines
565 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;
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