aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/FlexLayout.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-03-24 19:14:19 +0800
committercrupest <crupest@outlook.com>2021-03-24 19:14:19 +0800
commit7f15a1ff9a2007e119798053083a0a87d042990a (patch)
treecb35c01a7eaee867376d959b96c9bbd15df939e5 /src/ui/controls/FlexLayout.cpp
parent74956951ee663012df0c3fe4ebe29799cb2f7732 (diff)
parent7703063a5816b089483e78ccd74bb9902ccfbea8 (diff)
downloadcru-7f15a1ff9a2007e119798053083a0a87d042990a.tar.gz
cru-7f15a1ff9a2007e119798053083a0a87d042990a.tar.bz2
cru-7f15a1ff9a2007e119798053083a0a87d042990a.zip
Merge branch 'master' of https://github.com/crupest/CruUI
Diffstat (limited to 'src/ui/controls/FlexLayout.cpp')
-rw-r--r--src/ui/controls/FlexLayout.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ui/controls/FlexLayout.cpp b/src/ui/controls/FlexLayout.cpp
index b7f350dc..e390241f 100644
--- a/src/ui/controls/FlexLayout.cpp
+++ b/src/ui/controls/FlexLayout.cpp
@@ -8,6 +8,7 @@ using render::FlexLayoutRenderObject;
FlexLayout::FlexLayout() {
render_object_.reset(new FlexLayoutRenderObject());
render_object_->SetAttachedControl(this);
+ SetContainerRenderObject(render_object_.get());
}
FlexLayout::~FlexLayout() = default;
@@ -60,13 +61,12 @@ void FlexLayout::SetFlexDirection(FlexDirection direction) {
render_object_->SetFlexDirection(direction);
}
-void FlexLayout::OnAddChild(Control* child, const Index position) {
- render_object_->AddChild(child->GetRenderObject(), position);
+FlexCrossAlignment FlexLayout::GetItemCrossAlign() const {
+ return render_object_->GetItemCrossAlign();
}
-void FlexLayout::OnRemoveChild(Control* child, const Index position) {
- CRU_UNUSED(child)
-
- render_object_->RemoveChild(position);
+void FlexLayout::SetItemCrossAlign(FlexCrossAlignment alignment) {
+ if (alignment == GetItemCrossAlign()) return;
+ render_object_->SetItemCrossAlign(alignment);
}
} // namespace cru::ui::controls