raven/src/BoxLayout.hpp
2022-07-07 18:29:35 +03:00

37 lines
616 B
C++

#pragma once
#include "src/Layout.hpp"
#include "src/Widget.hpp"
#include "src/Box.hpp"
#include <memory>
#include <vector>
namespace Raven {
class BoxLayout : public Layout {
public:
enum class SlotType {
No,
Percent,
Pixel
};
struct Slot {
double percent, pixel;
SlotType type;
};
public:
BoxLayout(Direction direction)
: Layout()
, m_direction(direction) {}
~BoxLayout() {}
void run();
void slot_percent(double percent);
void slot_pixel(double pixel);
private:
std::vector<Slot> m_slots;
Direction m_direction { Direction::Horizontal };
};
}