From 6b4edc9be8ec556147c195cf2047d92b9439efd7 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Tue, 18 Nov 2025 00:46:27 +0800 Subject: Bring back ControlHost and refactor tree management of control. --- src/ui/render/ScrollBar.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/ui/render/ScrollBar.cpp') diff --git a/src/ui/render/ScrollBar.cpp b/src/ui/render/ScrollBar.cpp index 3834fffb..4343f15a 100644 --- a/src/ui/render/ScrollBar.cpp +++ b/src/ui/render/ScrollBar.cpp @@ -8,7 +8,7 @@ #include "cru/platform/gui/Cursor.h" #include "cru/ui/Base.h" #include "cru/ui/ThemeManager.h" -#include "cru/ui/controls/Window.h" +#include "cru/ui/controls/ControlHost.h" #include "cru/ui/render/ScrollRenderObject.h" #include @@ -317,8 +317,8 @@ void ScrollBar::OnDraw(platform::graphics::IPainter* painter, void ScrollBar::SetCursor() { if (const auto control = render_object_->GetAttachedControl()) { - if (const auto window = control->GetWindow()) { - window->SetOverrideCursor( + if (const auto host = control->GetControlHost()) { + host->SetOverrideCursor( GetUiApplication()->GetCursorManager()->GetSystemCursor( platform::gui::SystemCursorType::Arrow)); cursor_overridden_ = true; @@ -329,8 +329,8 @@ void ScrollBar::SetCursor() { void ScrollBar::RestoreCursor() { if (cursor_overridden_) { if (const auto control = render_object_->GetAttachedControl()) { - if (const auto window = control->GetWindow()) { - window->SetOverrideCursor(nullptr); + if (const auto host = control->GetControlHost()) { + host->SetOverrideCursor(nullptr); } } cursor_overridden_ = false; -- cgit v1.2.3