diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-11-21 21:43:42 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-11-21 21:43:42 +0800 |
| commit | 3b875091c445b7465b9bd044914318989a94d2ad (patch) | |
| tree | a358aebb488ec1ddc86bf87b8038bacd5d7515cb /include/cru/ui/controls/Container.h | |
| parent | 3cda35dbcbbe1e3854b880169c0efa0fc7a79264 (diff) | |
| download | cru-3b875091c445b7465b9bd044914318989a94d2ad.tar.gz cru-3b875091c445b7465b9bd044914318989a94d2ad.tar.bz2 cru-3b875091c445b7465b9bd044914318989a94d2ad.zip | |
Clean codes. Remove member function const.
Diffstat (limited to 'include/cru/ui/controls/Container.h')
| -rw-r--r-- | include/cru/ui/controls/Container.h | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/include/cru/ui/controls/Container.h b/include/cru/ui/controls/Container.h index 4fee178d..ba7dbd18 100644 --- a/include/cru/ui/controls/Container.h +++ b/include/cru/ui/controls/Container.h @@ -1,31 +1,26 @@ #pragma once -#include "SingleChildControl.h" - #include "../render/BorderRenderObject.h" #include "IBorderControl.h" +#include "SingleChildControl.h" namespace cru::ui::controls { class CRU_UI_API Container : public SingleChildControl<render::BorderRenderObject>, public virtual IBorderControl { - static constexpr std::string_view kControlType = "Container"; + static constexpr auto kControlName = "Container"; public: Container(); - CRU_DELETE_COPY(Container) - CRU_DELETE_MOVE(Container) - - ~Container() override; public: - bool IsBorderEnabled() const { + bool IsBorderEnabled() { return GetContainerRenderObject()->IsBorderEnabled(); } void SetBorderEnabled(bool enabled) { GetContainerRenderObject()->SetBorderEnabled(enabled); } - std::shared_ptr<platform::graphics::IBrush> GetForegroundBrush() const { + std::shared_ptr<platform::graphics::IBrush> GetForegroundBrush() { return GetContainerRenderObject()->GetForegroundBrush(); } void SetForegroundBrush( @@ -33,7 +28,7 @@ class CRU_UI_API Container GetContainerRenderObject()->SetForegroundBrush(brush); } - std::shared_ptr<platform::graphics::IBrush> GetBackgroundBrush() const { + std::shared_ptr<platform::graphics::IBrush> GetBackgroundBrush() { return GetContainerRenderObject()->GetBackgroundBrush(); } void SetBackgroundBrush( @@ -44,8 +39,5 @@ class CRU_UI_API Container void ApplyBorderStyle(const style::ApplyBorderStyleInfo& style) override { GetContainerRenderObject()->ApplyBorderStyle(style); } - - public: - std::string GetControlType() const final { return std::string(kControlType); } }; } // namespace cru::ui::controls |
