From 13d3d1b6044236bea1d5bdd9964424166267114a Mon Sep 17 00:00:00 2001 From: Roman Avdeev Date: Sun, 25 May 2025 16:29:07 +0400 Subject: [PATCH] Fixed volume scroll --- src/main.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index d5fde84..4edc978 100644 --- a/src/main.rs +++ b/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 {