Fixed volume scroll
This commit is contained in:
parent
2c082a4edf
commit
13d3d1b604
1 changed files with 17 additions and 2 deletions
19
src/main.rs
19
src/main.rs
|
|
@ -1168,8 +1168,23 @@ impl Application for App {
|
|||
volume += 0.0125;
|
||||
}
|
||||
}
|
||||
#[allow(dropping_copy_types)]
|
||||
_ => drop(delta), // placeholder, does nothing
|
||||
ScrollDelta::Lines { x, y } => {
|
||||
if y < 0.0 {
|
||||
// scrolling down, lower volume
|
||||
volume -= 0.0125;
|
||||
} else if y > 0.0 {
|
||||
// scrolling up, increase volume
|
||||
volume += 0.0125;
|
||||
}
|
||||
|
||||
if x > 0.0 {
|
||||
// scrolling left, lower volume
|
||||
volume -= 0.0125;
|
||||
} else if x < 0.0 {
|
||||
// scrolling right, increase volume
|
||||
volume += 0.0125;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (volume >= 0.0 && volume <= 1.0) && !nav_bar_toggled {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue