From 0f8f98b9005803ab154b43dcad0db1f292072a4d Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Mon, 17 Nov 2025 12:54:55 +0800 Subject: Refactor window host. --- src/ui/events/MouseEventArgs.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/ui/events/MouseEventArgs.cpp') diff --git a/src/ui/events/MouseEventArgs.cpp b/src/ui/events/MouseEventArgs.cpp index cad860d7..bbbf5cd4 100644 --- a/src/ui/events/MouseEventArgs.cpp +++ b/src/ui/events/MouseEventArgs.cpp @@ -1,7 +1,7 @@ #include "cru/ui/events/MouseEventArgs.h" #include "cru/ui/controls/Control.h" -#include "cru/ui/host/WindowHost.h" +#include "cru/ui/controls/Window.h" #include "cru/ui/render/RenderObject.h" namespace cru::ui::events { @@ -17,11 +17,9 @@ Point MouseEventArgs::GetPointToContent( Point MouseEventArgs::GetPointOfScreen() const { auto sender = GetSender(); if (auto control = dynamic_cast(sender)) { - if (auto host = control->GetWindowHost()) - return GetPoint() + control->GetWindowHost() - ->GetNativeWindow() - ->GetClientRect() - .GetLeftTop(); + if (auto window = control->GetWindow()) + return GetPoint() + + window->GetNativeWindow()->GetClientRect().GetLeftTop(); } return GetPoint(); } -- cgit v1.2.3