1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// SPDX-License-Identifier: Apache-2.0
use Duration;
use ;
/// Maximum distance (in logical/DP units) between two consecutive taps or
/// clicks for them to count as part of the same multi-click sequence
/// (double-click word select, triple-click line select, etc).
pub const MULTI_CLICK_DISTANCE_DP: f32 = 18.0;
/// Maximum finger movement (in logical/DP units) allowed during a
/// long-press before it's cancelled.
pub const TOUCH_LONG_PRESS_MOVE_TOLERANCE_DP: f32 = 8.0;
/// Maximum amount of time a touch must remain pressed before it is
/// recognized as a long-press gesture.
pub const TOUCH_LONG_PRESS_DURATION: Duration = from_millis;
/// A second click within this time window counts as a double/triple click.
pub const MULTI_CLICK_INTERVAL: Duration = from_millis;
/* ---- Scrollbar ---- */
/// Scrollbar thumb thickness while neither hovered nor pressed.
pub const DEFAULT_SCROLLBAR_THUMB_THICKNESS: f32 = 5.0;
/// Scrollbar thumb thickness while hovered or pressed, unless overridden.
pub const DEFAULT_SCROLLBAR_THUMB_HOVER_THICKNESS: f32 = 5.0;
// Eased transition applied to scroll position when animating toward a
// wheel/nudge target; drag updates bypass this and snap instantly.
pub const SCROLL_TRANSITION: Transition = new.easing;
pub const SCROLLBAR_THICKNESS_TRANSITION: Transition = new.easing;
/// Opacity applied to a `Scroll`-mode scrollbar axis that has nothing to
/// scroll, so it stays visible but reads as disabled instead of vanishing.
pub const SCROLLBAR_DISABLED_OPACITY: f32 = 0.35;
/// Padding (px) trimmed from each side of the scrollbar thumb's
/// cross-axis thickness, so it renders thinner than its track.
pub const SCROLLBAR_THUMB_PADDING: f32 = 4.0;
pub const SCROLLBAR_ARROW_SIZE: f32 = 6.0;
pub const SCROLLBAR_ARROW_CAP_SEGMENTS: usize = 24;
pub const SCROLLBAR_ARROW_CORNER_RADIUS: f32 = 1.8;
/* ---- Touch pan & momentum scrolling ---- */
/// Minimum finger movement (logical/DP units) since a touch-pan gesture
/// began before it actually starts translating content, filtering out
/// jitter on an otherwise stationary tap.
pub const TOUCH_PAN_THRESHOLD_DP: f32 = 6.0;
/// Exponential velocity decay rate (per second) applied to momentum
/// scrolling after a touch pan ends; higher values stop sooner.
pub const MOMENTUM_FRICTION: f32 = 4.2;
/// Momentum stops ticking once its speed drops below this (px/sec).
pub const MOMENTUM_MIN_SPEED: f32 = 4.0;
/* ---- AutoScroll (middle-click pan) ---- */
/// Radius (logical/DP units) around the activation point within which
/// cursor movement produces no scrolling, matching native AutoScroll.
pub const AUTO_SCROLL_DEAD_ZONE_DP: f32 = 4.0;
/// Cursor distance (logical/DP units) past the dead zone at which
/// AutoScroll reaches its maximum speed.
pub const AUTO_SCROLL_RANGE_DP: f32 = 220.0;
/// Maximum AutoScroll speed, in logical px/sec, reached at `AUTO_SCROLL_RANGE_DP`.
pub const AUTO_SCROLL_MAX_SPEED: f32 = 1600.0;
/* ---- Overscroll ---- */
/// Visual travel (px) a rubber-banded drag/fling asymptotically
/// approaches no matter how far past the bounds it's pulled.
pub const OVERSCROLL_RUBBER_BAND_RANGE: f32 = 90.0;
/// Eased transition used to spring an overscrolled offset back to bounds.
pub const OVERSCROLL_RETURN_TRANSITION: Transition = new.easing;
/// Edge-glow fade-out rate (alpha per second) for `Overscroll::Glow`.
pub const OVERSCROLL_GLOW_DECAY_PER_SEC: f32 = 2.6;