raven/src/BoxLayout.hpp

39 lines
614 B
C++
Raw Normal View History

2022-07-07 18:29:35 +03:00
#pragma once
2022-07-26 01:05:21 +03:00
#include "Layout.hpp"
#include "Widget.hpp"
#include "Box.hpp"
2022-07-07 18:29:35 +03:00
#include <memory>
#include <vector>
namespace Raven {
class BoxLayout : public Layout {
public:
enum class SlotType {
No,
Percent,
Pixel,
Auto
2022-07-07 18:29:35 +03:00
};
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 };
};
}