fix(workspace-list): debounce scroll events
This commit is contained in:
parent
35a8197670
commit
39623ad704
2 changed files with 36 additions and 12 deletions
|
|
@ -112,12 +112,12 @@ impl cosmic::Application for IcedWorkspacesApplet {
|
|||
}
|
||||
}
|
||||
Message::WheelScrolled(delta) => {
|
||||
let delta = match delta {
|
||||
ScrollDelta::Lines { x, y } => x + y,
|
||||
ScrollDelta::Pixels { x, y } => x + y,
|
||||
} as f64;
|
||||
let (delta, debounce) = match delta {
|
||||
ScrollDelta::Lines { x, y } => ((x + y) as f64, false),
|
||||
ScrollDelta::Pixels { x, y } => ((x + y) as f64, true),
|
||||
};
|
||||
if let Some(tx) = self.workspace_tx.as_mut() {
|
||||
let _ = tx.try_send(WorkspaceEvent::Scroll(delta));
|
||||
let _ = tx.try_send(WorkspaceEvent::Scroll(delta, debounce));
|
||||
}
|
||||
}
|
||||
Message::WorkspaceOverview => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue