aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/controls/flex_layout.hpp
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 /include/cru/ui/controls/flex_layout.hpp
parent068714c0f2fe7ab003462e5483f9944b0bf2f8e0 (diff)
downloadcru-477155d6fccc8eafadb6d7f4c468c9141d7d4e92.tar.gz
cru-477155d6fccc8eafadb6d7f4c468c9141d7d4e92.tar.bz2
cru-477155d6fccc8eafadb6d7f4c468c9141d7d4e92.zip
...
Diffstat (limited to 'include/cru/ui/controls/flex_layout.hpp')
-rw-r--r--include/cru/ui/controls/flex_layout.hpp32
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);