Adjust speed of pointer scrolling
This commit is contained in:
parent
1e61881b4f
commit
c5f777dc15
1 changed files with 5 additions and 2 deletions
|
|
@ -53,6 +53,9 @@ mod utils;
|
||||||
mod widgets;
|
mod widgets;
|
||||||
use dnd::{DragSurface, DragToplevel, DragWorkspace, DropTarget};
|
use dnd::{DragSurface, DragToplevel, DragWorkspace, DropTarget};
|
||||||
|
|
||||||
|
// Number of scroll pixels before changing workspace
|
||||||
|
const SCROLL_PIXELS: f32 = 24.0;
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, PartialEq, CosmicConfigEntry)]
|
#[derive(Clone, Debug, Default, PartialEq, CosmicConfigEntry)]
|
||||||
struct CosmicWorkspacesConfig {
|
struct CosmicWorkspacesConfig {
|
||||||
show_workspace_number: bool,
|
show_workspace_number: bool,
|
||||||
|
|
@ -688,10 +691,10 @@ impl Application for App {
|
||||||
y = -y;
|
y = -y;
|
||||||
|
|
||||||
let scroll = previous_scroll + y;
|
let scroll = previous_scroll + y;
|
||||||
if scroll <= -4. {
|
if scroll <= -SCROLL_PIXELS {
|
||||||
self.scroll = None;
|
self.scroll = None;
|
||||||
ScrollDirection::Prev
|
ScrollDirection::Prev
|
||||||
} else if scroll >= 4. {
|
} else if scroll >= SCROLL_PIXELS {
|
||||||
self.scroll = None;
|
self.scroll = None;
|
||||||
ScrollDirection::Next
|
ScrollDirection::Next
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue