diff options
Diffstat (limited to 'src/ui/style/Styler.cpp')
| -rw-r--r-- | src/ui/style/Styler.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/ui/style/Styler.cpp b/src/ui/style/Styler.cpp index 8b4405cd..251d403c 100644 --- a/src/ui/style/Styler.cpp +++ b/src/ui/style/Styler.cpp @@ -1,6 +1,5 @@ #include "cru/ui/style/Styler.h" -#include "../Helper.h" #include "cru/base/ClonePtr.h" #include "cru/platform/gui/Cursor.h" #include "cru/platform/gui/UiApplication.h" @@ -14,42 +13,44 @@ namespace cru::ui::style { BorderStyler::BorderStyler(ApplyBorderStyleInfo style) : style_(std::move(style)) {} -void BorderStyler::Apply(controls::Control *control) const { - if (auto border_control = dynamic_cast<controls::IBorderControl *>(control)) { +void BorderStyler::Apply(controls::Control* control) const { + if (auto border_control = dynamic_cast<controls::IBorderControl*>(control)) { border_control->ApplyBorderStyle(style_); } } ClonePtr<CursorStyler> CursorStyler::Create( platform::gui::SystemCursorType type) { - return Create(GetUiApplication()->GetCursorManager()->GetSystemCursor(type)); + return Create(platform::gui::IUiApplication::GetInstance() + ->GetCursorManager() + ->GetSystemCursor(type)); } -void CursorStyler::Apply(controls::Control *control) const { +void CursorStyler::Apply(controls::Control* control) const { control->SetCursor(cursor_); } -void PreferredSizeStyler::Apply(controls::Control *control) const { +void PreferredSizeStyler::Apply(controls::Control* control) const { control->SetPreferredSize(size_); } -void MarginStyler::Apply(controls::Control *control) const { +void MarginStyler::Apply(controls::Control* control) const { control->SetMargin(margin_); } -void PaddingStyler::Apply(controls::Control *control) const { +void PaddingStyler::Apply(controls::Control* control) const { control->SetPadding(padding_); } -void ContentBrushStyler::Apply(controls::Control *control) const { +void ContentBrushStyler::Apply(controls::Control* control) const { if (auto content_brush_control = - dynamic_cast<controls::IContentBrushControl *>(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)) { +void FontStyler::Apply(controls::Control* control) const { + if (auto font_control = dynamic_cast<controls::IFontControl*>(control)) { font_control->SetFont(font_); } } |
