diff options
Diffstat (limited to 'include/cru/ui/controls/flex_layout.hpp')
-rw-r--r-- | include/cru/ui/controls/flex_layout.hpp | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/include/cru/ui/controls/flex_layout.hpp b/include/cru/ui/controls/flex_layout.hpp index 7861534a..52eaec75 100644 --- a/include/cru/ui/controls/flex_layout.hpp +++ b/include/cru/ui/controls/flex_layout.hpp @@ -1,17 +1,7 @@ #pragma once #include "../layout_control.hpp" -#include "../render/flex_layout_render_object.hpp" - -#include <memory> - namespace cru::ui::controls { -// import these basic entities -using render::FlexChildLayoutData; -using render::FlexCrossAlignment; -using render::FlexDirection; -using render::FlexMainAlignment; - class FlexLayout : public LayoutControl { public: static constexpr std::string_view control_type = "FlexLayout"; @@ -26,29 +16,17 @@ class FlexLayout : public LayoutControl { FlexLayout(FlexLayout&& other) = delete; FlexLayout& operator=(const FlexLayout& other) = delete; FlexLayout& operator=(FlexLayout&& other) = delete; - ~FlexLayout() override = default; + ~FlexLayout() override; std::string_view GetControlType() const final { return control_type; } render::RenderObject* GetRenderObject() const override; - FlexMainAlignment GetContentMainAlign() const { - return render_object_->GetContentMainAlign(); - } - - void SetContentMainAlign(FlexMainAlignment value) { - if (value == GetContentMainAlign()) return; - render_object_->SetContentMainAlign(value); - } - - FlexDirection GetFlexDirection() const { - return render_object_->GetFlexDirection(); - } + FlexMainAlignment GetContentMainAlign() const; + void SetContentMainAlign(FlexMainAlignment value); - void SetFlexDirection(FlexDirection direction) { - if (direction == GetFlexDirection()) return; - render_object_->SetFlexDirection(direction); - } + FlexDirection GetFlexDirection() const; + void SetFlexDirection(FlexDirection direction); FlexChildLayoutData GetChildLayoutData(Control* control); void SetChildLayoutData(Control* control, const FlexChildLayoutData& data); |