Merge pull request #3068 from dtzxporter/fix-slider-cursor

Fall back to `Pointer` cursor for `slider` widget on Windows
This commit is contained in:
Héctor 2025-11-29 15:23:14 +01:00 committed by GitHub
commit be79690cd1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 4 deletions

View file

@ -533,9 +533,19 @@ where
let state = tree.state.downcast_ref::<State>();
if state.is_dragging {
mouse::Interaction::Grabbing
// FIXME: Fall back to `Pointer` on Windows
// See https://github.com/rust-windowing/winit/issues/1043
if cfg!(target_os = "windows") {
mouse::Interaction::Pointer
} else {
mouse::Interaction::Grabbing
}
} else if cursor.is_over(layout.bounds()) {
mouse::Interaction::Grab
if cfg!(target_os = "windows") {
mouse::Interaction::Pointer
} else {
mouse::Interaction::Grab
}
} else {
mouse::Interaction::default()
}

View file

@ -525,9 +525,19 @@ where
let state = tree.state.downcast_ref::<State>();
if state.is_dragging {
mouse::Interaction::Grabbing
// FIXME: Fall back to `Pointer` on Windows
// See https://github.com/rust-windowing/winit/issues/1043
if cfg!(target_os = "windows") {
mouse::Interaction::Pointer
} else {
mouse::Interaction::Grabbing
}
} else if cursor.is_over(layout.bounds()) {
mouse::Interaction::Grab
if cfg!(target_os = "windows") {
mouse::Interaction::Pointer
} else {
mouse::Interaction::Grab
}
} else {
mouse::Interaction::default()
}