18class ASplitterHelper {
19 friend class ASplitter;
26 ASplitterHelper() =
default;
27 ASplitterHelper(ALayoutDirection direction) : mDirection(direction) {}
29 void setDirection(ALayoutDirection direction) {
30 mDirection = direction;
33 void beginDrag(
const glm::ivec2& mousePos);
34 bool mouseDrag(
const glm::ivec2& mousePos);
36 mDraggingDividerIndex = -1;
40 const AVector<Item>& items()
const {
return mItems; }
42 void setItems(AVector<Item> items) {
43 mItems = std::move(items);
46 void setItems(
const AVector<_<AView>>& items) {
47 mItems = items.map([](
const _<AView>& view) {
return Item { .view = view }; });
51 bool isDragging()
const {
52 return mDraggingDividerIndex != -1;
55 bool isDraggingArea(glm::ivec2 position);
81 ALayoutDirection mDirection;
82 size_t mDraggingDividerIndex = -1;
86 float getTotalOccupiedSizeOf(
const _<AView>& view) {
87 return mDirection == ALayoutDirection::VERTICAL ? view->getTotalOccupiedHeight() : view->getTotalOccupiedWidth();
92 T& getAxisValue(glm::tvec2<T>& v) {
93 return aui::layout_direction::getAxisValue(mDirection, v);
98 T getAxisValue(
const glm::tvec2<T>& v) {
99 return aui::layout_direction::getAxisValue(mDirection, v);
int reclaimSpace(int space, size_t dividerIndex)
Reclaims space via specified divider index.
Definition ASplitterHelper.cpp:135