From fadecd0068a3818b6b2072ddc0096d0b8b2293ca Mon Sep 17 00:00:00 2001 From: user0-07161 Date: Mon, 19 May 2025 16:33:32 +0200 Subject: [PATCH] fix: don't change volume on scroll when sidebar is toggled otherwise, potential scrolling in the sidebar inferes with volume control by scrolling --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index d9ea615..bc39929 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,8 +8,7 @@ use cosmic::{ iced::{ event::{self, Event}, keyboard::{Event as KeyEvent, Key, Modifiers}, - mouse::Event as MouseEvent, - mouse::ScrollDelta, + mouse::{Event as MouseEvent, ScrollDelta}, subscription::Subscription, window, Alignment, Background, Border, Color, ContentFit, Length, Limits, }, @@ -1146,6 +1145,7 @@ impl Application for App { } } Message::Scrolled(delta) => { + let nav_bar_toggled = self.core.nav_bar_active(); if let Some(video) = &mut self.video_opt { let mut volume = video.volume(); match delta { @@ -1170,7 +1170,7 @@ impl Application for App { _ => drop(delta), // placeholder, does nothing } - if volume >= 0.0 && volume <= 1.0 { + if (volume >= 0.0 && volume <= 1.0) && !nav_bar_toggled { video.set_volume(volume); self.update_controls(true); }