aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/flex_layout.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-03-18 22:37:41 +0800
committercrupest <crupest@outlook.com>2020-03-18 22:37:41 +0800
commit477155d6fccc8eafadb6d7f4c468c9141d7d4e92 (patch)
tree0fe935c8f699a1c42c8750a39b6ca70d31f941a0 /src/ui/controls/flex_layout.cpp
parent068714c0f2fe7ab003462e5483f9944b0bf2f8e0 (diff)
downloadcru-477155d6fccc8eafadb6d7f4c468c9141d7d4e92.tar.gz
cru-477155d6fccc8eafadb6d7f4c468c9141d7d4e92.tar.bz2
cru-477155d6fccc8eafadb6d7f4c468c9141d7d4e92.zip
...
Diffstat (limited to 'src/ui/controls/flex_layout.cpp')
-rw-r--r--src/ui/controls/flex_layout.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ui/controls/flex_layout.cpp b/src/ui/controls/flex_layout.cpp
index 6ea26d92..1c649e3b 100644
--- a/src/ui/controls/flex_layout.cpp
+++ b/src/ui/controls/flex_layout.cpp
@@ -10,6 +10,8 @@ FlexLayout::FlexLayout() {
render_object_->SetAttachedControl(this);
}
+FlexLayout::~FlexLayout() = default;
+
render::RenderObject* FlexLayout::GetRenderObject() const {
return render_object_.get();
}
@@ -39,6 +41,24 @@ void FlexLayout::SetChildLayoutData(Control* control,
FindPosition(render_object_.get(), control->GetRenderObject())) = data;
}
+FlexMainAlignment FlexLayout::GetContentMainAlign() const {
+ return render_object_->GetContentMainAlign();
+}
+
+void FlexLayout::SetContentMainAlign(FlexMainAlignment value) {
+ if (value == GetContentMainAlign()) return;
+ render_object_->SetContentMainAlign(value);
+}
+
+FlexDirection FlexLayout::GetFlexDirection() const {
+ return render_object_->GetFlexDirection();
+}
+
+void FlexLayout::SetFlexDirection(FlexDirection direction) {
+ if (direction == GetFlexDirection()) return;
+ render_object_->SetFlexDirection(direction);
+}
+
void FlexLayout::OnAddChild(Control* child, int position) {
render_object_->AddChild(child->GetRenderObject(), position);
}