fix: don't change volume on scroll when sidebar is toggled
otherwise, potential scrolling in the sidebar inferes with volume control by scrolling
This commit is contained in:
parent
94982b4a4a
commit
fadecd0068
1 changed files with 3 additions and 3 deletions
|
|
@ -8,8 +8,7 @@ use cosmic::{
|
||||||
iced::{
|
iced::{
|
||||||
event::{self, Event},
|
event::{self, Event},
|
||||||
keyboard::{Event as KeyEvent, Key, Modifiers},
|
keyboard::{Event as KeyEvent, Key, Modifiers},
|
||||||
mouse::Event as MouseEvent,
|
mouse::{Event as MouseEvent, ScrollDelta},
|
||||||
mouse::ScrollDelta,
|
|
||||||
subscription::Subscription,
|
subscription::Subscription,
|
||||||
window, Alignment, Background, Border, Color, ContentFit, Length, Limits,
|
window, Alignment, Background, Border, Color, ContentFit, Length, Limits,
|
||||||
},
|
},
|
||||||
|
|
@ -1146,6 +1145,7 @@ impl Application for App {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Message::Scrolled(delta) => {
|
Message::Scrolled(delta) => {
|
||||||
|
let nav_bar_toggled = self.core.nav_bar_active();
|
||||||
if let Some(video) = &mut self.video_opt {
|
if let Some(video) = &mut self.video_opt {
|
||||||
let mut volume = video.volume();
|
let mut volume = video.volume();
|
||||||
match delta {
|
match delta {
|
||||||
|
|
@ -1170,7 +1170,7 @@ impl Application for App {
|
||||||
_ => drop(delta), // placeholder, does nothing
|
_ => 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);
|
video.set_volume(volume);
|
||||||
self.update_controls(true);
|
self.update_controls(true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue