Fall back to Pointer cursor for slider widget on Windows
Co-authored-by: dtzxporter <dtzxporter@users.noreply.github.com>
This commit is contained in:
parent
39ca9e0233
commit
c469dc8a0b
2 changed files with 24 additions and 4 deletions
|
|
@ -533,9 +533,19 @@ where
|
||||||
let state = tree.state.downcast_ref::<State>();
|
let state = tree.state.downcast_ref::<State>();
|
||||||
|
|
||||||
if state.is_dragging {
|
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()) {
|
} else if cursor.is_over(layout.bounds()) {
|
||||||
mouse::Interaction::Grab
|
if cfg!(target_os = "windows") {
|
||||||
|
mouse::Interaction::Pointer
|
||||||
|
} else {
|
||||||
|
mouse::Interaction::Grab
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mouse::Interaction::default()
|
mouse::Interaction::default()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -525,9 +525,19 @@ where
|
||||||
let state = tree.state.downcast_ref::<State>();
|
let state = tree.state.downcast_ref::<State>();
|
||||||
|
|
||||||
if state.is_dragging {
|
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()) {
|
} else if cursor.is_over(layout.bounds()) {
|
||||||
mouse::Interaction::Grab
|
if cfg!(target_os = "windows") {
|
||||||
|
mouse::Interaction::Pointer
|
||||||
|
} else {
|
||||||
|
mouse::Interaction::Grab
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mouse::Interaction::default()
|
mouse::Interaction::default()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue