From 221f9cd7e453f2968c12a14a46588ea50ca2119d Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 4 Mar 2022 21:26:48 +0800 Subject: ... --- src/ui/style/Styler.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/ui') diff --git a/src/ui/style/Styler.cpp b/src/ui/style/Styler.cpp index 44a24462..3d7ff1f9 100644 --- a/src/ui/style/Styler.cpp +++ b/src/ui/style/Styler.cpp @@ -6,6 +6,8 @@ #include "cru/platform/gui/UiApplication.h" #include "cru/ui/controls/Control.h" #include "cru/ui/controls/IBorderControl.h" +#include "cru/ui/controls/IContentBrushControl.h" +#include "cru/ui/controls/IFontControl.h" #include "cru/ui/style/ApplyBorderStyleInfo.h" namespace cru::ui::style { @@ -38,4 +40,17 @@ void MarginStyler::Apply(controls::Control *control) const { void PaddingStyler::Apply(controls::Control *control) const { control->SetPadding(padding_); } + +void ContentBrushStyler::Apply(controls::Control *control) const { + if (auto content_brush_control = + dynamic_cast(control)) { + content_brush_control->SetContentBrush(brush_); + } +} + +void FontStyler::Apply(controls::Control *control) const { + if (auto font_control = dynamic_cast(control)) { + font_control->SetFont(font_); + } +} } // namespace cru::ui::style -- cgit v1.2.3