Tweak get_cursor code (#713)

Co-authored-by: Daniel McNab <36049421+DJMcNab@users.noreply.github.com>
This commit is contained in:
Olivier FAURE 2024-10-23 16:37:45 +02:00 committed by GitHub
parent e03dfdd82b
commit 30cb1e0b13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -368,7 +368,7 @@ impl_context_method!(
// --- MARK: CURSOR ---
// Cursor-related impls.
impl_context_method!(EventCtx<'_>, {
impl_context_method!(MutateCtx<'_>, EventCtx<'_>, UpdateCtx<'_>, {
/// Notifies Masonry that the cursor returned by [`Widget::get_cursor`] has changed.
///
/// This is mostly meant for cases where the cursor changes even if the pointer doesn't

View File

@ -224,6 +224,8 @@ pub trait Widget: AsAny {
/// Return the cursor icon for this widget.
///
/// This will be called when the mouse moves or [`cursor_icon_changed`](MutateCtx::cursor_icon_changed) is called.
///
/// **pos** - the mouse position in global coordinates (e.g. `(0,0)` is the top-left corner of the
/// window).
fn get_cursor(&self, ctx: &QueryCtx, pos: Point) -> CursorIcon {