From d97c14a922b60e89a9892e519b95b7e793aff543 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Fri, 21 Nov 2025 22:21:07 +0800 Subject: Remove ui Helper.h,cpp --- src/ui/style/Styler.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/ui/style/Styler.cpp') 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(control)) { +void BorderStyler::Apply(controls::Control* control) const { + if (auto border_control = dynamic_cast(control)) { border_control->ApplyBorderStyle(style_); } } ClonePtr 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(control)) { + dynamic_cast(control)) { content_brush_control->SetContentBrush(brush_); } } -void FontStyler::Apply(controls::Control *control) const { - if (auto font_control = dynamic_cast(control)) { +void FontStyler::Apply(controls::Control* control) const { + if (auto font_control = dynamic_cast(control)) { font_control->SetFont(font_); } } -- cgit v1.2.3