Skip to content

Commit

Permalink
Tweak get_cursor code (#713)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel McNab <36049421+DJMcNab@users.noreply.github.com>
  • Loading branch information
PoignardAzur and DJMcNab authored Oct 23, 2024
1 parent e03dfdd commit 30cb1e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion masonry/src/contexts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions masonry/src/widget/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 30cb1e0

Please sign in to comment.