diff options
author | crupest <crupest@outlook.com> | 2019-12-13 01:02:47 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-12-13 01:02:47 +0800 |
commit | 9110574bb51e9e2959842a7641f598d34c3cd847 (patch) | |
tree | 96ee1f5b3c40095e4e923fc763de0663ee6a01aa /include/cru/ui/controls/button.hpp | |
parent | f2aa96fba0b72eeeadf5160ea5df2c8143ec8aa0 (diff) | |
download | cru-9110574bb51e9e2959842a7641f598d34c3cd847.tar.gz cru-9110574bb51e9e2959842a7641f598d34c3cd847.tar.bz2 cru-9110574bb51e9e2959842a7641f598d34c3cd847.zip |
...
Diffstat (limited to 'include/cru/ui/controls/button.hpp')
-rw-r--r-- | include/cru/ui/controls/button.hpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/include/cru/ui/controls/button.hpp b/include/cru/ui/controls/button.hpp index d4a03e1d..60b1243f 100644 --- a/include/cru/ui/controls/button.hpp +++ b/include/cru/ui/controls/button.hpp @@ -3,24 +3,19 @@ #include "../click_detector.hpp" #include "../render/border_render_object.hpp" -#include "cru/platform/graph/brush.hpp" #include "cru/platform/native/basic_types.hpp" #include <memory> -namespace cru::ui::render { -class BorderRenderObject; -} - namespace cru::ui::controls { using render::CornerRadius; struct ButtonStateStyle { - std::shared_ptr<platform::graph::Brush> border_brush; + std::shared_ptr<platform::graph::IBrush> border_brush; Thickness border_thickness; CornerRadius border_radius; - std::shared_ptr<platform::graph::Brush> foreground_brush; - std::shared_ptr<platform::graph::Brush> background_brush; + std::shared_ptr<platform::graph::IBrush> foreground_brush; + std::shared_ptr<platform::graph::IBrush> background_brush; }; struct ButtonStyle { @@ -47,7 +42,7 @@ enum class ButtonState { class Button : public ContentControl { public: - static constexpr auto control_type = L"Button"; + static constexpr std::string_view control_type = "Button"; static Button* Create() { return new Button(); } @@ -61,7 +56,7 @@ class Button : public ContentControl { Button& operator=(Button&& other) = delete; ~Button() override = default; - std::wstring_view GetControlType() const override final { + std::string_view GetControlType() const final { return control_type; } @@ -96,7 +91,7 @@ class Button : public ContentControl { } private: - std::shared_ptr<render::BorderRenderObject> render_object_{}; + std::unique_ptr<render::BorderRenderObject> render_object_{}; ButtonState state_ = ButtonState::Normal; |