From fb1b16cd0ab189d61efe6237b2c2b1f7f72f90de Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 5 Nov 2018 23:25:57 +0800 Subject: Develop cursor. --- src/ui/control.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ui/control.cpp') diff --git a/src/ui/control.cpp b/src/ui/control.cpp index d080ebb0..5215c107 100644 --- a/src/ui/control.cpp +++ b/src/ui/control.cpp @@ -322,6 +322,14 @@ namespace cru { } } + void Control::SetCursor(const Cursor::Ptr& cursor) + { + cursor_ = cursor; + const auto window = GetWindow(); + if (window && window->GetMouseHoverControl() == this) + window->UpdateCursor(); + } + void Control::OnAddChild(Control* child) { if (auto window = GetWindow()) -- cgit v1.2.3