aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/controls
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/ui/controls')
-rw-r--r--include/cru/ui/controls/Button.hpp3
-rw-r--r--include/cru/ui/controls/Container.hpp3
-rw-r--r--include/cru/ui/controls/ContentControl.hpp12
-rw-r--r--include/cru/ui/controls/FlexLayout.hpp4
-rw-r--r--include/cru/ui/controls/StackLayout.hpp4
5 files changed, 12 insertions, 14 deletions
diff --git a/include/cru/ui/controls/Button.hpp b/include/cru/ui/controls/Button.hpp
index e8285507..5619ec89 100644
--- a/include/cru/ui/controls/Button.hpp
+++ b/include/cru/ui/controls/Button.hpp
@@ -28,9 +28,6 @@ class Button : public ContentControl {
const ButtonStyle& GetStyle() const { return style_; }
void SetStyle(ButtonStyle style);
- protected:
- void OnChildChanged(Control* old_child, Control* new_child) override;
-
private:
std::unique_ptr<render::BorderRenderObject> render_object_{};
diff --git a/include/cru/ui/controls/Container.hpp b/include/cru/ui/controls/Container.hpp
index d9cb8aec..18958837 100644
--- a/include/cru/ui/controls/Container.hpp
+++ b/include/cru/ui/controls/Container.hpp
@@ -19,9 +19,6 @@ class Container : public ContentControl {
render::RenderObject* GetRenderObject() const override;
- protected:
- void OnChildChanged(Control* old_child, Control* new_child) override;
-
private:
std::unique_ptr<render::BorderRenderObject> render_object_;
};
diff --git a/include/cru/ui/controls/ContentControl.hpp b/include/cru/ui/controls/ContentControl.hpp
index 47720a87..1bdaf7e4 100644
--- a/include/cru/ui/controls/ContentControl.hpp
+++ b/include/cru/ui/controls/ContentControl.hpp
@@ -1,6 +1,8 @@
#pragma once
#include "Control.hpp"
+#include "cru/ui/render/RenderObject.hpp"
+
namespace cru::ui::controls {
class ContentControl : public Control {
protected:
@@ -19,8 +21,18 @@ class ContentControl : public Control {
protected:
virtual void OnChildChanged(Control* old_child, Control* new_child);
+ render::RenderObject* GetContainerRenderObject() const {
+ return container_render_object_;
+ }
+ void SetContainerRenderObject(render::RenderObject* ro) {
+ container_render_object_ = ro;
+ }
+
private:
using Control::AddChild;
using Control::RemoveChild;
+
+ private:
+ render::RenderObject* container_render_object_ = nullptr;
};
} // namespace cru::ui::controls
diff --git a/include/cru/ui/controls/FlexLayout.hpp b/include/cru/ui/controls/FlexLayout.hpp
index a6c6a40c..4f6abfdb 100644
--- a/include/cru/ui/controls/FlexLayout.hpp
+++ b/include/cru/ui/controls/FlexLayout.hpp
@@ -34,10 +34,6 @@ class FlexLayout : public LayoutControl {
FlexChildLayoutData GetChildLayoutData(Control* control);
void SetChildLayoutData(Control* control, FlexChildLayoutData data);
- protected:
- void OnAddChild(Control* child, Index position) override;
- void OnRemoveChild(Control* child, Index position) override;
-
private:
std::shared_ptr<render::FlexLayoutRenderObject> render_object_;
};
diff --git a/include/cru/ui/controls/StackLayout.hpp b/include/cru/ui/controls/StackLayout.hpp
index 373b4681..aa9440c2 100644
--- a/include/cru/ui/controls/StackLayout.hpp
+++ b/include/cru/ui/controls/StackLayout.hpp
@@ -21,10 +21,6 @@ class StackLayout : public LayoutControl {
render::RenderObject* GetRenderObject() const override;
- protected:
- void OnAddChild(Control* child, Index position) override;
- void OnRemoveChild(Control* child, Index position) override;
-
private:
std::shared_ptr<render::StackLayoutRenderObject> render_object_;
};