diff options
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/ui/control.cpp | 1 | ||||
| -rw-r--r-- | src/ui/controls/button.cpp | 2 | ||||
| -rw-r--r-- | src/ui/controls/flex_layout.cpp | 20 | ||||
| -rw-r--r-- | src/ui/ui_manager.cpp | 4 |
5 files changed, 26 insertions, 2 deletions
diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index dbd42d38..14cbf2fb 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -45,6 +45,7 @@ target_sources(cru_ui PUBLIC ${CRU_UI_INCLUDE_DIR}/controls/text_box.hpp ${CRU_UI_INCLUDE_DIR}/controls/text_block.hpp ${CRU_UI_INCLUDE_DIR}/controls/text_common.hpp + ${CRU_UI_INCLUDE_DIR}/render/base.hpp ${CRU_UI_INCLUDE_DIR}/render/border_render_object.hpp ${CRU_UI_INCLUDE_DIR}/render/canvas_render_object.hpp ${CRU_UI_INCLUDE_DIR}/render/flex_layout_render_object.hpp diff --git a/src/ui/control.cpp b/src/ui/control.cpp index cde602b7..04d89b5f 100644 --- a/src/ui/control.cpp +++ b/src/ui/control.cpp @@ -1,6 +1,5 @@ #include "cru/ui/control.hpp" -#include "cru/platform/native/basic_types.hpp" #include "cru/platform/native/cursor.hpp" #include "cru/platform/native/ui_application.hpp" #include "cru/platform/native/window.hpp" diff --git a/src/ui/controls/button.cpp b/src/ui/controls/button.cpp index 7dc5a5d7..7dd087ba 100644 --- a/src/ui/controls/button.cpp +++ b/src/ui/controls/button.cpp @@ -58,6 +58,8 @@ Button::Button() : click_detector_(this) { }); } +Button::~Button() = default; + render::RenderObject* Button::GetRenderObject() const { return render_object_.get(); } 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); } diff --git a/src/ui/ui_manager.cpp b/src/ui/ui_manager.cpp index 2a6d6e5b..5c7e4577 100644 --- a/src/ui/ui_manager.cpp +++ b/src/ui/ui_manager.cpp @@ -58,6 +58,8 @@ UiManager::UiManager() { theme_resource_.button_style.hover.border_radius = theme_resource_.button_style.press.border_radius = theme_resource_.button_style.press_cancel.border_radius = - controls::CornerRadius({5, 5}); + CornerRadius({5, 5}); } + +UiManager::~UiManager() = default; } // namespace cru::ui |
