Use mouse::Cursor::is_over in slider
This commit is contained in:
parent
cdf02ddda9
commit
83041f6880
2 changed files with 4 additions and 4 deletions
|
|
@ -327,7 +327,7 @@ where
|
|||
Event::Mouse(mouse::Event::WheelScrolled { delta })
|
||||
if state.keyboard_modifiers.control() =>
|
||||
{
|
||||
if let Some(_) = cursor.position_over(layout.bounds()) {
|
||||
if cursor.is_over(layout.bounds()) {
|
||||
let delta = match delta {
|
||||
mouse::ScrollDelta::Lines { x: _, y } => y,
|
||||
mouse::ScrollDelta::Pixels { x: _, y } => y,
|
||||
|
|
@ -343,7 +343,7 @@ where
|
|||
}
|
||||
}
|
||||
Event::Keyboard(keyboard::Event::KeyPressed { key, .. }) => {
|
||||
if cursor.position_over(layout.bounds()).is_some() {
|
||||
if cursor.is_over(layout.bounds()) {
|
||||
match key {
|
||||
Key::Named(key::Named::ArrowUp) => {
|
||||
let _ = increment(current_value).map(change);
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ where
|
|||
Event::Mouse(mouse::Event::WheelScrolled { delta })
|
||||
if state.keyboard_modifiers.control() =>
|
||||
{
|
||||
if let Some(_) = cursor.position_over(layout.bounds()) {
|
||||
if cursor.is_over(layout.bounds()) {
|
||||
let delta = match delta {
|
||||
mouse::ScrollDelta::Lines { x: _, y } => y,
|
||||
mouse::ScrollDelta::Pixels { x: _, y } => y,
|
||||
|
|
@ -348,7 +348,7 @@ where
|
|||
}
|
||||
}
|
||||
Event::Keyboard(keyboard::Event::KeyPressed { key, .. }) => {
|
||||
if cursor.position_over(layout.bounds()).is_some() {
|
||||
if cursor.is_over(layout.bounds()) {
|
||||
match key {
|
||||
Key::Named(key::Named::ArrowUp) => {
|
||||
let _ = increment(current_value).map(change);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue