diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-11-21 22:21:07 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-11-21 22:21:07 +0800 |
| commit | d97c14a922b60e89a9892e519b95b7e793aff543 (patch) | |
| tree | b90a31c72496070772b4ee9ed4312b9113093e65 /src/ui/style/Styler.cpp | |
| parent | fd61739197ec009d47da87a7cc66970a55f12db4 (diff) | |
| download | cru-d97c14a922b60e89a9892e519b95b7e793aff543.tar.gz cru-d97c14a922b60e89a9892e519b95b7e793aff543.tar.bz2 cru-d97c14a922b60e89a9892e519b95b7e793aff543.zip | |
Remove ui Helper.h,cpp
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_); } } |
