Skip to content

Commit c45894a

Browse files
committed
Adjust speed of pointer scrolling
1 parent f7fbcef commit c45894a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ mod utils;
5252
mod widgets;
5353
use dnd::{DragSurface, DragToplevel, DragWorkspace, DropTarget};
5454

55+
// Number of scroll pixels before changing workspace
56+
const SCROLL_PIXELS: f32 = 24.0;
57+
5558
#[derive(Clone, Debug, Default, PartialEq, CosmicConfigEntry)]
5659
struct CosmicWorkspacesConfig {
5760
show_workspace_number: bool,
@@ -636,10 +639,10 @@ impl Application for App {
636639
y = -y;
637640

638641
let scroll = previous_scroll + y;
639-
if scroll <= -4. {
642+
if scroll <= -SCROLL_PIXELS {
640643
self.scroll = None;
641644
ScrollDirection::Prev
642-
} else if scroll >= 4. {
645+
} else if scroll >= SCROLL_PIXELS {
643646
self.scroll = None;
644647
ScrollDirection::Next
645648
} else {

0 commit comments

Comments
 (0)