diff options
author | crupest <crupest@outlook.com> | 2020-12-02 19:38:25 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-12-02 19:38:25 +0800 |
commit | d7dca1be0dd0814e30fa63924a20af3d924e974c (patch) | |
tree | 0a5ea0b637dc8392eee67ec625a51cef09ec8731 /include/cru/ui/controls | |
parent | 145cfd5b82d76e0c937eceda707aa22427899943 (diff) | |
download | cru-d7dca1be0dd0814e30fa63924a20af3d924e974c.tar.gz cru-d7dca1be0dd0814e30fa63924a20af3d924e974c.tar.bz2 cru-d7dca1be0dd0814e30fa63924a20af3d924e974c.zip |
...
Diffstat (limited to 'include/cru/ui/controls')
-rw-r--r-- | include/cru/ui/controls/Button.hpp | 8 | ||||
-rw-r--r-- | include/cru/ui/controls/IBorderControl.hpp | 10 |
2 files changed, 17 insertions, 1 deletions
diff --git a/include/cru/ui/controls/Button.hpp b/include/cru/ui/controls/Button.hpp index 0d2f4898..7299c146 100644 --- a/include/cru/ui/controls/Button.hpp +++ b/include/cru/ui/controls/Button.hpp @@ -2,11 +2,15 @@ #include "ContentControl.hpp" #include "../helper/ClickDetector.hpp" +#include "IBorderControl.hpp" #include "IClickableControl.hpp" #include "cru/common/Event.hpp" +#include "cru/ui/style/ApplyBorderStyleInfo.hpp" namespace cru::ui::controls { -class Button : public ContentControl, public virtual IClickableControl { +class Button : public ContentControl, + public virtual IClickableControl, + public virtual IBorderControl { public: static constexpr std::u16string_view control_type = u"Button"; @@ -35,6 +39,8 @@ class Button : public ContentControl, public virtual IClickableControl { return click_detector_.StateChangeEvent(); } + void ApplyBorderStyle(const style::ApplyBorderStyleInfo& style) override; + const ButtonStyle& GetStyle() const { return style_; } void SetStyle(ButtonStyle style); diff --git a/include/cru/ui/controls/IBorderControl.hpp b/include/cru/ui/controls/IBorderControl.hpp new file mode 100644 index 00000000..817305ef --- /dev/null +++ b/include/cru/ui/controls/IBorderControl.hpp @@ -0,0 +1,10 @@ +#pragma once +#include "../style/ApplyBorderStyleInfo.hpp" +#include "Base.hpp" +#include "cru/common/Base.hpp" + +namespace cru::ui::controls { +struct IBorderControl : virtual Interface { + virtual void ApplyBorderStyle(const style::ApplyBorderStyleInfo& style) = 0; +}; +} // namespace cru::ui::controls |