mirror of https://github.com/linebender/xilem
Tweak get_cursor code (#713)
Co-authored-by: Daniel McNab <36049421+DJMcNab@users.noreply.github.com>
This commit is contained in:
parent
e03dfdd82b
commit
30cb1e0b13
|
@ -368,7 +368,7 @@ impl_context_method!(
|
||||||
|
|
||||||
// --- MARK: CURSOR ---
|
// --- MARK: CURSOR ---
|
||||||
// Cursor-related impls.
|
// 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.
|
/// 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
|
/// This is mostly meant for cases where the cursor changes even if the pointer doesn't
|
||||||
|
|
|
@ -224,6 +224,8 @@ pub trait Widget: AsAny {
|
||||||
|
|
||||||
/// Return the cursor icon for this widget.
|
/// 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
|
/// **pos** - the mouse position in global coordinates (e.g. `(0,0)` is the top-left corner of the
|
||||||
/// window).
|
/// window).
|
||||||
fn get_cursor(&self, ctx: &QueryCtx, pos: Point) -> CursorIcon {
|
fn get_cursor(&self, ctx: &QueryCtx, pos: Point) -> CursorIcon {
|
||||||
|
|
Loading…
Reference in New Issue