aboutsummaryrefslogtreecommitdiff
path: root/src/ui/style/Styler.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-03-04 21:26:48 +0800
committercrupest <crupest@outlook.com>2022-03-04 21:26:48 +0800
commit221f9cd7e453f2968c12a14a46588ea50ca2119d (patch)
tree278a2ade6817b1656d89051aaae5b26658112a4c /src/ui/style/Styler.cpp
parenta0732c3aa32d200bf154d486df3c9f506161954f (diff)
downloadcru-221f9cd7e453f2968c12a14a46588ea50ca2119d.tar.gz
cru-221f9cd7e453f2968c12a14a46588ea50ca2119d.tar.bz2
cru-221f9cd7e453f2968c12a14a46588ea50ca2119d.zip
...
Diffstat (limited to 'src/ui/style/Styler.cpp')
-rw-r--r--src/ui/style/Styler.cpp15
1 files changed, 15 insertions, 0 deletions
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<controls::IContentBrushControl *>(control)) {
+ content_brush_control->SetContentBrush(brush_);
+ }
+}
+
+void FontStyler::Apply(controls::Control *control) const {
+ if (auto font_control = dynamic_cast<controls::IFontControl *>(control)) {
+ font_control->SetFont(font_);
+ }
+}
} // namespace cru::ui::style