From a0732c3aa32d200bf154d486df3c9f506161954f Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 4 Mar 2022 21:21:15 +0800 Subject: ... --- include/cru/ui/controls/IconButton.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'include/cru/ui/controls/IconButton.h') diff --git a/include/cru/ui/controls/IconButton.h b/include/cru/ui/controls/IconButton.h index 4f347b33..a76d01d4 100644 --- a/include/cru/ui/controls/IconButton.h +++ b/include/cru/ui/controls/IconButton.h @@ -1,4 +1,5 @@ #pragma once +#include #include "NoChildControl.h" #include "../helper/ClickDetector.h" @@ -6,12 +7,15 @@ #include "../render/GeometryRenderObject.h" #include "IBorderControl.h" #include "IClickableControl.h" +#include "IContentBrushControl.h" #include "cru/common/Event.h" +#include "cru/platform/graphics/Brush.h" namespace cru::ui::controls { class CRU_UI_API IconButton : public NoChildControl, public virtual IClickableControl, - public virtual IBorderControl { + public virtual IBorderControl, + public virtual IContentBrushControl { public: static constexpr StringView kControlType = u"IconButton"; @@ -85,6 +89,15 @@ class CRU_UI_API IconButton : public NoChildControl, void SetIconWithSvgPathDataStringResourceKey( StringView icon_svg_path_data_string_resource_key, const Rect& view_port); + std::shared_ptr GetContentBrush() const override { + return GetIconFillBrush(); + } + + void SetContentBrush( + std::shared_ptr brush) override { + SetIconFillBrush(std::move(brush)); + } + private: std::unique_ptr container_render_object_; std::unique_ptr geometry_render_object_; -- cgit v1.2.3